home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Internet Tools 1993 July / Internet Tools.iso / RockRidge / mail / elm / elm2.4 / Configure < prev    next >
Encoding:
Text File  |  1993-06-06  |  110.7 KB  |  4,981 lines

  1. #! /bin/sh
  2. #
  3. # If these # comments don't work, trim them.  Don't worry about any other
  4. # shell scripts, Configure will trim # comments from them for you.
  5. #
  6. # (If you are trying to port this package to a machine without sh, I would
  7. # suggest you cut out the prototypical config.h from the end of Configure
  8. # and edit it to reflect your system.  Some packages may include samples
  9. # of config.h for certain machines, so you might look for one of those.)
  10. #
  11. # $Header: /home/syd/elm.rel/RCS/Configure,v 5.28 1993/06/06 18:11:06 syd Exp $
  12. #
  13. # Yes, you may rip this off to use in other distribution packages.
  14. # (Note: this Configure script was generated automatically.  Rather than
  15. # working with this copy of Configure, you may wish to get metaconfig.)
  16.  
  17. : sanity checks
  18. PATH=".:/bin:/usr/bin:/usr/local/bin:/usr/ucb:/usr/local:/usr/lbin:/etc:/usr/new:/usr/new/bin:/usr/nbin:$PATH"
  19. export PATH || (echo "OOPS, this isn't sh.  Desperation time.  I will feed myself to sh."; sh $0; kill $$)
  20.  
  21. if test ! -t 0; then
  22.     echo "Say 'sh Configure', not 'sh <Configure'"
  23.     exit 1
  24. fi
  25.  
  26. (alias) >/dev/null 2>&1 && \
  27.     echo "(I see you are using the Korn shell.  Some ksh's blow up on Configure," && \
  28.     echo "especially on exotic machines.  If yours does, try the Bourne shell instead.)"
  29.  
  30. if test ! -d ../UU; then
  31.     if test ! -d UU; then
  32.     mkdir UU
  33.     fi
  34.     cd UU
  35. fi
  36.  
  37. case "$1" in
  38. -d) shift; fastread='yes';;
  39. esac
  40.  
  41. Log=''
  42. Header=''
  43. bin=''
  44. contains=''
  45. cppstdin=''
  46. cppminus=''
  47. d_getopt=''
  48. d_memcpy=''
  49. d_mkdir=''
  50. d_rename=''
  51. d_symlink=''
  52. d_whoami=''
  53. n=''
  54. c=''
  55. orderlib=''
  56. ranlib=''
  57. package=''
  58. pager=''
  59. prefshell=''
  60. startsh=''
  61. d_eunice=''
  62. define=''
  63. eunicefix=''
  64. loclist=''
  65. expr=''
  66. sed=''
  67. echo=''
  68. cat=''
  69. rm=''
  70. mv=''
  71. cp=''
  72. tail=''
  73. tr=''
  74. mkdir=''
  75. sort=''
  76. uniq=''
  77. grep=''
  78. trylist=''
  79. test=''
  80. inews=''
  81. ispell=''
  82. egrep=''
  83. more=''
  84. pg=''
  85. Mcc=''
  86. vi=''
  87. mailx=''
  88. mail=''
  89. cpp=''
  90. perl=''
  91. emacs=''
  92. ls=''
  93. rmail=''
  94. sendmail=''
  95. shar=''
  96. smail=''
  97. submit=''
  98. tbl=''
  99. troff=''
  100. nroff=''
  101. uname=''
  102. uuname=''
  103. line=''
  104. chgrp=''
  105. chmod=''
  106. lint=''
  107. sleep=''
  108. pr=''
  109. tar=''
  110. ln=''
  111. lpr=''
  112. lp=''
  113. touch=''
  114. make=''
  115. date=''
  116. csh=''
  117. pmake=''
  118. mips=''
  119. col=''
  120. pack=''
  121. compress=''
  122. execmail=''
  123. libswanted=''
  124. c_date=''
  125. d_altcheck=''
  126. d_ascii=''
  127. d_calendar=''
  128. calendar=''
  129. d_content=''
  130. d_crypt=''
  131. cryptlib=''
  132. d_cuserid=''
  133. d_disphost=''
  134. d_domname=''
  135. d_usegetdom=''
  136. d_errlst=''
  137. d_flock=''
  138. d_dotlock=''
  139. d_fcntlock=''
  140. lock_dir=''
  141. has_flock=''
  142. has_fcntl=''
  143. d_ftruncate=''
  144. d_gethname=''
  145. d_douname=''
  146. d_host_comp=''
  147. ign_hname=''
  148. d_havetlib=''
  149. termlib=''
  150. d_index=''
  151. d_internet=''
  152. d_ispell=''
  153. ispell_path=''
  154. ispell_options=''
  155. d_locale=''
  156. d_nl_types=''
  157. d_msgcat=''
  158. d_usenls=''
  159. d_mallocvoid=''
  160. d_mboxedit=''
  161. d_mime=''
  162. defencoding=''
  163. defcharset=''
  164. defdispcharset=''
  165. d_mmdf=''
  166. d_newauto=''
  167. d_noaddfrom=''
  168. d_usedomain=''
  169. d_nocheckvalid=''
  170. d_noxheader=''
  171. d_pidcheck=''
  172. d_ptem=''
  173. d_putenv=''
  174. d_remlock=''
  175. maxattempts=''
  176. d_setgid=''
  177. d_savegrpmboxid=''
  178. mailermode=''
  179. d_sigvec=''
  180. d_sigvectr=''
  181. d_sigset=''
  182. d_sighold=''
  183. d_sigprocmask=''
  184. d_sigblock=''
  185. d_sigaction=''
  186. d_strcspn=''
  187. d_strspn=''
  188. d_strpbrk=''
  189. d_strerror=''
  190. d_strftime=''
  191. d_strings=''
  192. d_pwdinsys=''
  193. strings=''
  194. includepath=''
  195. d_strstr=''
  196. d_strtok=''
  197. d_subshell=''
  198. d_tempnam=''
  199. tempnamo=''
  200. tempnamc=''
  201. d_termio=''
  202. d_termios=''
  203. d_tz_min=''
  204. d_tzname=''
  205. d_useembed=''
  206. d_utimbuf=''
  207. d_vfork=''
  208. defbatsub=''
  209. defeditor=''
  210. editoropts=''
  211. hostname=''
  212. phostname=''
  213. mydomain=''
  214. autohostname=''
  215. i_memory=''
  216. i_stdlib=''
  217. i_time=''
  218. i_systime=''
  219. d_systimekernel=''
  220. i_unistd=''
  221. i_utime=''
  222. i_sysutime=''
  223. lib=''
  224. libc=''
  225. linepr=''
  226. maildir=''
  227. mailer=''
  228. mailgrp=''
  229. mansrc=''
  230. catmansrc=''
  231. manext=''
  232. manext_choice=''
  233. catmanext=''
  234. catmanext_choice=''
  235. packed=''
  236. manroff=''
  237. manroffopts=''
  238. suffix=''
  239. packer=''
  240. models=''
  241. split=''
  242. small=''
  243. medium=''
  244. large=''
  245. huge=''
  246. optimize=''
  247. ccflags=''
  248. cppflags=''
  249. ldflags=''
  250. cc=''
  251. libs=''
  252. nametype=''
  253. d_passnames=''
  254. d_berknames=''
  255. d_usgnames=''
  256. passcat=''
  257. rmttape=''
  258. roff=''
  259. roffopts=''
  260. sigtype=''
  261. spitshell=''
  262. shsharp=''
  263. sharpbang=''
  264. tmpdir=''
  265. use_pmake=''
  266. xencf=''
  267. xenlf=''
  268. d_xenix=''
  269. d_bsd=''
  270. CONFIG=''
  271. : set package name
  272. package=elm2
  273.  
  274. echo " "
  275. echo "Beginning of configuration questions for $package kit."
  276. : Eunice requires " " instead of "", can you believe it
  277. echo " "
  278.  
  279. define='define'
  280. undef='undef'
  281. : change the next line if compiling for Xenix/286 on Xenix/386
  282. xlibpth='/usr/lib/386 /lib/386 /lib'
  283. libpth='/usr/lib /usr/ccs/lib /usr/local/lib /usr/lib/large /lib '$xlibpth' /lib/large /usr/lib/small /lib/small'
  284. smallmach='pdp11 i8086 z8000 i80286 iAPX286'
  285. rmlist='kit[1-9]isdone kit[1-9][0-9]isdone'
  286. trap 'echo " "; rm -f $rmlist; exit 1' 1 2 3
  287.  
  288. : We must find out about Eunice early
  289. eunicefix=':'
  290. if test -f /etc/unixtovms; then
  291.     eunicefix=/etc/unixtovms
  292. fi
  293. if test -f /etc/unixtovms.exe; then
  294.     eunicefix=/etc/unixtovms.exe
  295. fi
  296.  
  297. : Now test for existence of everything in MANIFEST
  298.  
  299. echo "First let's make sure your kit is complete.  Checking..."
  300. awk '$1 !~ /PACKINGLIST/ {print $1}' ../MANIFEST | split -100
  301. rm -f missing
  302. for filelist in x??; do
  303.     (cd ..; ls `cat UU/$filelist` >/dev/null 2>>UU/missing)
  304. done
  305. if test -s missing; then
  306.     cat missing
  307.     kill $$
  308. fi
  309. echo "Looks good..."
  310.  
  311. : Do one time items.....
  312.  
  313. for file in OneTime.PL* ; do
  314.     if test -f "$file" ; then
  315.         echo "Executing patch cleanup script $file . . ."
  316.         . ./$file
  317.     fi
  318. done
  319. d_newshome="/usr/NeWS"
  320. defvoidused=7
  321. attrlist="mc68000 sun gcos unix ibm gimpel interdata tss os mert pyr"
  322. attrlist="$attrlist vax pdp11 i8086 z8000 u3b2 u3b5 u3b20 u3b200"
  323. attrlist="$attrlist hpux hp9000s300 hp9000s500 hp9000s800"
  324. attrlist="$attrlist ns32000 ns16000 iAPX286 mc300 mc500 mc700 sparc"
  325. attrlist="$attrlist nsc32000 sinix xenix venix posix ansi M_XENIX"
  326. attrlist="$attrlist $mc68k __STDC__ UTS M_I8086 M_I186 M_I286 M_I386"
  327. attrlist="$attrlist i186 __m88k__ m88k DGUX __DGUX__ NeXT _AIX ultrix"
  328. pth="/bin /usr/bin /usr/ucb /sbin /usr/sbin /usr/local /usr/local/bin /usr/lbin"
  329. pth="$pth /usr/5bin /vol/local/bin /etc /usr/bsd /usr/lib /usr/ccs/lib /usr/ccs/bin /lib"
  330. pth="$pth /usr/local/lib /sys5.3/bin /sys5.3/usr/bin /bsd4.3/bin /bsd4.3/usr/bin /bsd4.3/usr/ucb"
  331. pth="$pth /usr/convex /usr/mmdf/bin /usr/mmdf/lib /usr/lib/mail"
  332. pth="$pth ${BSDBASE-/bsd}/usr/ucb ${BSDBASE-/bsd}/bin ${BSDBASE-/bsd}/usr/bin"
  333.  
  334. : check for out bin directory
  335. if test ! -d ../bin; then
  336.     echo "Making bin directory"
  337.     mkdir ../bin
  338. else
  339.     echo "Found bin directory"
  340. fi
  341.  
  342. libswanted="intl nls"
  343. attrlist="$attrlist sgi"
  344.  
  345. : some greps do not return status, grrr.
  346. echo "grimblepritz" >grimble
  347. if grep blurfldyick grimble >/dev/null 2>&1 ; then
  348.     contains=contains
  349. elif grep grimblepritz grimble >/dev/null 2>&1 ; then
  350.     contains=grep
  351. else
  352.     contains=contains
  353. fi
  354. rm -f grimble
  355. : the following should work in any shell
  356. case "$contains" in
  357. contains*)
  358.     echo " "
  359.     echo "AGH!  Grep doesn't return a status.  Attempting remedial action."
  360.     cat >contains <<'EOSS'
  361. grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
  362. EOSS
  363. chmod +x contains
  364. esac
  365.  
  366. : see if sh knows # comments
  367. echo " "
  368. echo "Checking your sh to see if it knows about # comments..."
  369. if sh -c '#' >/dev/null 2>&1 ; then
  370.     echo "Your sh handles # comments correctly."
  371.     shsharp=true
  372.     spitshell=cat
  373.     echo " "
  374.     echo "Okay, let's see if #! works on this system..."
  375.     e=/bin/echo; test -f $e || e=/usr/bin/echo
  376.     echo "#!$e hi" > try
  377.     $eunicefix try
  378.     chmod +x try
  379.     ./try > today
  380.     if $contains hi today >/dev/null 2>&1; then
  381.     echo "It does."
  382.     sharpbang='#!'
  383.     else
  384.     echo "#! $e hi" > try
  385.     $eunicefix try
  386.     chmod +x try
  387.     ./try > today
  388.     if test -s today; then
  389.         echo "It does."
  390.         sharpbang='#! '
  391.     else
  392.         echo "It doesn't."
  393.         sharpbang=': use '
  394.     fi
  395.     fi
  396. else
  397.     echo "Your sh doesn't grok # comments--I will strip them later on."
  398.     shsharp=false
  399.     echo "exec grep -v '^#'" >spitshell
  400.     chmod +x spitshell
  401.     $eunicefix spitshell
  402.     spitshell=`pwd`/spitshell
  403.     echo "I presume that if # doesn't work, #! won't work either!"
  404.     sharpbang=': use '
  405. fi
  406.  
  407. : figure out how to guarantee sh startup
  408. echo " "
  409. echo "Checking out how to guarantee sh startup..."
  410. startsh=$sharpbang'/bin/sh'
  411. echo "Let's see if '$startsh' works..."
  412. cat >try <<EOSS
  413. $startsh
  414. set abc
  415. test "$?abc" != 1
  416. EOSS
  417.  
  418. chmod +x try
  419. $eunicefix try
  420. if ./try; then
  421.     echo "Yup, it does."
  422. else
  423.     echo "Nope.  You may have to fix up the shell scripts to make sure sh runs them."
  424. fi
  425. rm -f try today
  426.  
  427. : first determine how to suppress newline on echo command
  428. echo "Checking echo to see how to suppress newlines..."
  429. (echo "hi there\c" ; echo " ") >.echotmp
  430. if $contains c .echotmp >/dev/null 2>&1 ; then
  431.     echo "...using -n."
  432.     n='-n'
  433.     c=''
  434. else
  435.     cat <<'EOM'
  436. ...using \c
  437. EOM
  438.     n=''
  439.     c='\c'
  440. fi
  441. echo $n "Type carriage return to continue.  Your cursor should be here-->$c"
  442. read ans
  443. rm -f .echotmp
  444.  
  445. : now set up to do reads with possible shell escape and default assignment
  446. cat <<EOSC >myread
  447. case "\$fastread" in
  448. yes) ans=''; echo " " ;;
  449. *) ans='!';;
  450. esac
  451. while expr "X\$ans" : "X!" >/dev/null; do
  452.     read ans
  453.     case "\$ans" in
  454.     !)
  455.     sh
  456.     echo " "
  457.     echo $n "\$rp $c"
  458.     ;;
  459.     !*)
  460.     set \`expr "X\$ans" : "X!\(.*\)\$"\`
  461.     sh -c "\$*"
  462.     echo " "
  463.     echo $n "\$rp $c"
  464.     ;;
  465.     esac
  466. done
  467. rp='Your answer:'
  468. case "\$ans" in
  469. '') ans="\$dflt";;
  470. esac
  471. EOSC
  472.  
  473. : general instructions
  474. cat <<EOH
  475.  
  476. This installation shell script will examine your system and ask you questions
  477. to determine how the $package package should be installed.  If you get stuck
  478. on a question, you may use a ! shell escape to start a subshell or execute
  479. a command.  Many of the questions will have default answers in square
  480. brackets--typing carriage return will give you the default.
  481.  
  482. On some of the questions which ask for file or directory names you are
  483. allowed to use the ~name construct to specify the login directory belonging
  484. to "name", even if you don't have a shell which knows about that.  Questions
  485. where this is allowed will be marked "(~name ok)".
  486.  
  487. EOH
  488. rp="[Type carriage return to continue]"
  489. echo $n "$rp $c"
  490. . myread
  491. cat <<EOH
  492.  
  493. Much effort has been expended to ensure that this shell script will run
  494. on any Unix system.  If despite that it blows up on you, your best bet is
  495. to edit Configure and run it again. Also, let the Elm Development Group
  496. (elm@dsi.com) know how they blew it.  If you can't run Configure for
  497. some reason, you'll have to generate a config.sh file by hand.
  498.  
  499. This installation script affects things in two ways: 1) it may do direct
  500. variable substitutions on some of the files included in this kit, and
  501. 2) it builds a config.h file for inclusion in C programs.  You may edit
  502. any of these files as the need arises after running this script.
  503.  
  504. If you make a mistake on a question, there is no easy way to back up to it
  505. currently.  The easiest thing to do is to edit config.sh and rerun all the
  506. SH files.  Configure will offer to let you do this before it runs the SH files.
  507.  
  508. EOH
  509. rp="[Type carriage return to continue]"
  510. echo $n "$rp $c"
  511. . myread
  512.  
  513. : get old answers, if there is a config file out there
  514. if test -f ../config.sh; then
  515.     echo " "
  516.     dflt=y
  517.     rp="I see a config.sh file.  Did Configure make it on THIS system? [$dflt]"
  518.     echo $n "$rp $c"
  519.     . myread
  520.     case "$ans" in
  521.     n*) echo "OK, I'll ignore it.";;
  522.     *)  echo "Fetching default answers from your old config.sh file..."
  523.     tmp="$n"
  524.     ans="$c"
  525.         . ../config.sh
  526.     n="$tmp"
  527.     c="$ans"
  528.     ;;
  529.     esac
  530. fi
  531.  
  532. : find out where common programs are
  533. echo " "
  534. echo "Locating common programs..."
  535. cat <<EOSC >loc
  536. $startsh
  537. case \$# in
  538. 0) exit 1;;
  539. esac
  540. thing=\$1
  541. shift
  542. dflt=\$1
  543. shift
  544. for dir in \$*; do
  545.     case "\$thing" in
  546.     .)
  547.     if test -d \$dir/\$thing; then
  548.         echo \$dir
  549.         exit 0
  550.     fi
  551.     ;;
  552.     *)
  553.     if test -f \$dir/\$thing; then
  554.         echo \$dir/\$thing
  555.         exit 0
  556.     elif test -f \$dir/\$thing.exe; then
  557.         : on Eunice apparently
  558.         echo \$dir/\$thing
  559.         exit 0
  560.     fi
  561.     ;;
  562.     esac
  563. done
  564. echo \$dflt
  565. exit 1
  566. EOSC
  567. chmod +x loc
  568. $eunicefix loc
  569. loclist="
  570. cat
  571. chgrp
  572. chmod
  573. cp
  574. echo
  575. expr
  576. grep
  577. ln
  578. ls
  579. make
  580. mv
  581. rm
  582. sed
  583. sleep
  584. touch
  585. tr
  586. "
  587. trylist="
  588. Mcc
  589. compress
  590. cpp
  591. date
  592. emacs
  593. execmail
  594. ispell
  595. line
  596. lint
  597. lp
  598. lpr
  599. mailx
  600. mips
  601. more
  602. nroff
  603. pack
  604. pg
  605. pmake
  606. pr
  607. rmail
  608. sendmail
  609. shar
  610. smail
  611. submit
  612. tar
  613. tbl
  614. test
  615. troff
  616. uname
  617. uuname
  618. vi
  619. "
  620. for file in $loclist; do
  621.     xxx=`loc $file $file $pth`
  622.     eval $file=$xxx
  623.     eval _$file=$xxx
  624.     case "$xxx" in
  625.     /*)
  626.     echo $file is in $xxx.
  627.     ;;
  628.     *)
  629.     echo "I don't know where $file is.  I hope it's in everyone's PATH."
  630.     ;;
  631.     esac
  632. done
  633. echo " "
  634. echo "Don't worry if any of the following aren't found..."
  635. ans=offhand
  636. for file in $trylist; do
  637.     xxx=`loc $file $file $pth`
  638.     eval $file=$xxx
  639.     eval _$file=$xxx
  640.     case "$xxx" in
  641.     /*)
  642.     echo $file is in $xxx.
  643.     ;;
  644.     *)
  645.     echo "I don't see $file out there, $ans."
  646.     ans=either
  647.     ;;
  648.     esac
  649. done
  650. case "$egrep" in
  651. egrep)
  652.     echo "Substituting grep for egrep."
  653.     egrep=$grep
  654.     ;;
  655. esac
  656. case "$test" in
  657. test)
  658.     echo "Hopefully test is built into your sh."
  659.     ;;
  660. /bin/test)
  661.     if sh -c "PATH= test true" >/dev/null 2>&1; then
  662.     echo "Using the test built into your sh."
  663.     test=test
  664.     fi
  665.     ;;
  666. *)
  667.     test=test
  668.     ;;
  669. esac
  670. case "$echo" in
  671. echo)
  672.     echo "Hopefully echo is built into your sh."
  673.     ;;
  674. /bin/echo)
  675.     echo " "
  676.     echo "Checking compatibility between /bin/echo and builtin echo (if any)..."
  677.     $echo $n "hi there$c" >foo1
  678.     echo $n "hi there$c" >foo2
  679.     if cmp foo1 foo2 >/dev/null 2>&1; then
  680.     echo "They are compatible.  In fact, they may be identical."
  681.     else
  682.     case "$n" in
  683.     '-n') n='' c='\c' ans='\c' ;;
  684.     *) n='-n' c='' ans='-n' ;;
  685.     esac
  686.     cat <<FOO
  687. They are not compatible!  You are probably running ksh on a non-USG system.
  688. I'll have to use /bin/echo instead of the builtin, since Bourne shell doesn't
  689. have echo built in and we may have to run some Bourne shell scripts.  That
  690. means I'll have to use $ans to suppress newlines now.  Life is ridiculous.
  691.  
  692. FOO
  693.     rp="Your cursor should be here-->"
  694.     $echo $n "$rp$c"
  695.     . myread
  696.     fi
  697.     $rm -f foo1 foo2
  698.     ;;
  699. *)
  700.     : cross your fingers
  701.     echo=echo
  702.     ;;
  703. esac
  704. rmlist="$rmlist loc"
  705.  
  706. : set up shell script to do ~ expansion
  707. cat >filexp <<EOSS
  708. $startsh
  709. : expand filename
  710. case "\$1" in
  711.  ~/*|~)
  712.     echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
  713.     ;;
  714.  ~*)
  715.     if $test -f /bin/csh; then
  716.     /bin/csh -f -c "glob \$1"
  717.     echo ""
  718.     else
  719.     name=\`$expr x\$1 : '..\([^/]*\)'\`
  720.     dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
  721.     if $test ! -d "\$dir"; then
  722.         me=\`basename \$0\`
  723.         echo "\$me: can't locate home directory for: \$name" >&2
  724.         exit 1
  725.     fi
  726.     case "\$1" in
  727.     */*)
  728.         echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
  729.         ;;
  730.     *)
  731.         echo \$dir
  732.         ;;
  733.     esac
  734.     fi
  735.     ;;
  736. *)
  737.     echo \$1
  738.     ;;
  739. esac
  740. EOSS
  741. chmod +x filexp
  742. $eunicefix filexp
  743.  
  744. : determine where public executables go
  745. case "$bin" in
  746. '')
  747.     dflt=`loc . /bin /usr/local/bin /usr/lbin /usr/local /usr/bin`
  748.     ;;
  749. *)  dflt="$bin"
  750.     ;;
  751. esac
  752. cont=true
  753. while $test "$cont" ; do
  754.     echo " "
  755.     rp="Where do you want to put the public executables? [$dflt]"
  756.     $echo $n "$rp $c"
  757.     . myread
  758.     bin="$ans"
  759.     bin=`filexp $bin`
  760.     if test -d $bin; then
  761.     cont=''
  762.     else
  763.     case "$fastread" in
  764.     yes) dflt=y;;
  765.     *) dflt=n;;
  766.     esac
  767.     rp="Directory $bin doesn't exist.  Use that name anyway? [$dflt]"
  768.     $echo $n "$rp $c"
  769.     . myread
  770.     dflt=''
  771.     case "$ans" in
  772.     y*) cont='';;
  773.     esac
  774.     fi
  775. done
  776.  
  777. : see if date exists, if so, init c_date
  778. if $test ! "x$date" = "x" ; then
  779.     c_date=`LANGUAGE= $date`
  780. else
  781.     c_date='date was unavailable at configuration'
  782. fi
  783.  
  784. : get calendar mode and default calendar file name
  785. $cat <<EOM
  786.  
  787. There is a neat feature that enables scanning of the message body for
  788. entries to add to the users ".calendar" (or whatever) file.  These
  789. entries are then processed by the system program calendar.  To use
  790. this feature it needs to be enabled.  The name of the per user calendar
  791. file used by your system's calendar program is also required.
  792. EOM
  793.  
  794. case "$d_calendar" in
  795. "$define") dflt=y;;
  796. "$undef")  dflt=n;;
  797. *)       dflt=y;;
  798. esac
  799.  
  800. rp="Enable calendar feature [$dflt]"
  801. $echo $n "$rp $c"
  802. . myread
  803. case "$ans" in
  804. y*) d_calendar="$define";;
  805. *)  d_calendar="$undef";;
  806. esac
  807.  
  808. case "$calendar" in
  809.     '') dflt='calendar';;
  810.     *)  dflt=$calendar;;
  811. esac
  812.  
  813. if $test "$d_calendar" = "$define"; then
  814.     echo " "
  815.     rp="Default calendar file: [$dflt]"
  816.     $echo $n "$rp $c"
  817.     . myread
  818.     calendar="$ans"
  819. fi
  820.  
  821. : make some quick guesses about what we are up against
  822. echo " "
  823. $echo $n "Hmm...  $c"
  824. if $test -f "$uname"; then
  825.     uname_os=`$uname -s`
  826.     uname_rel=`$uname -r`
  827.     uname_rel=`expr "$uname_rel" : "\(...\).*"`
  828. else
  829.     uname_os=unknown
  830.     uname_rel=unknown
  831. fi
  832. cat /usr/include/signal.h /usr/include/sys/signal.h >foo
  833. if test `echo abc | tr a-z A-Z` = Abc ; then
  834.     echo "Looks kind of like a USG system, but we'll see..."
  835.     echo exit 1 >bsd
  836.     echo exit 0 >usg
  837.     echo exit 1 >v7
  838. elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
  839.     if $test "(" "$uname_os" = "SunOS" -a "$uname_rel" = "4.1" ")" ; then
  840.     echo "Looks like SunOs 4.1, a USG system, but we'll see..."
  841.     echo exit 1 >bsd
  842.     echo exit 0 >usg
  843.     echo exit 1 >v7
  844.     elif $test "$uname_os" = "OSF1" ; then
  845.     echo "Looks like an OSF/1 system, but we'll see.."
  846.     echo exit 1 >bsd
  847.     echo exit 1 >usg
  848.     echo exit 1 >v7
  849.     else
  850.     echo "Looks kind of like a BSD system, but we'll see..."
  851.     echo exit 0 >bsd
  852.     echo exit 1 >usg
  853.     echo exit 1 >v7
  854.     fi
  855. else
  856.     echo "Looks kind of like a version 7 system, but we'll see..."
  857.     echo exit 1 >bsd
  858.     echo exit 1 >usg
  859.     echo exit 0 >v7
  860. fi
  861. case "$eunicefix" in
  862. *unixtovms*)
  863.     cat <<'EOI'
  864. There is, however, a strange, musty smell in the air that reminds me of
  865. something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
  866. EOI
  867.     echo "exit 0" >eunice
  868.     d_eunice="$define"
  869.     ;;
  870. *)
  871.     echo " "
  872.     echo "Congratulations.  You aren't running Eunice."
  873.     d_eunice="$undef"
  874.     echo "exit 1" >eunice
  875.     ;;
  876. esac
  877. if test -f /xenix; then
  878.     echo "Actually, this looks more like a XENIX system..."
  879.     echo "exit 0" >xenix
  880. else
  881.     echo " "
  882.     echo "It's not Xenix..."
  883.     echo "exit 1" >xenix
  884. fi
  885. chmod +x xenix
  886. $eunicefix xenix
  887. if test -f /venix; then
  888.     echo "Actually, this looks more like a VENIX system..."
  889.     echo "exit 0" >venix
  890. else
  891.     echo " "
  892.     if xenix; then
  893.     : null
  894.     else
  895.     echo "Nor is it Venix..."
  896.     fi
  897.     echo "exit 1" >venix
  898. fi
  899. chmod +x bsd usg v7 eunice venix
  900. $eunicefix bsd usg v7 eunice venix
  901. rm -rf foo
  902. rmlist="$rmlist bsd usg v7 eunice venix xenix"
  903.  
  904. # determine text processor to use, default to troff if found.
  905. case "$roff" in
  906. '')
  907.     if $test -n "$troff"; then
  908.     dflt="$troff"
  909.     else
  910.     dflt=$nroff
  911.     fi
  912.     ;;
  913. *)  dflt="$roff";;
  914. esac
  915. $cat <<EOM
  916.  
  917. The Elm documentation (Reference Guide, Configuration Guide, etc.) is set up
  918. for troff.  If you only have nroff, it can be used, but the documentation will
  919. not be as readable.  If you use an alternate processor for troff/nroff
  920. documents it can be specified here.  Elm expects the text processor to write
  921. to standard out.  You will be given a chance to provide command line options
  922. to this command in the next question.
  923.  
  924. EOM
  925. cont=true
  926. while $test "$cont" ; do
  927.     echo " "
  928.     echo "Give the name of the program used to format the Elm documentation on"
  929.     $echo $n "your system: [$dflt] $c"
  930.     rp="Preferred Elm documentation formatter program: [$dflt]"
  931.     . myread
  932.     roff=$ans;
  933.     if $test -f "$ans"; then
  934.     cont=''
  935.     else
  936.     lookup=`loc "$ans" "" . $pth`
  937.     if $test -f "$lookup"; then
  938.         cont=''
  939.         roff=$lookup
  940.     else
  941.         if $test "$fastread" = yes; then
  942.         dflt=y
  943.         else
  944.         dflt=n
  945.         fi
  946.         echo "Text processor $ans doesn't exist."
  947.         rp="Use that name anyway? [$dflt]"
  948.         $echo $n "$rp $c"
  949.         . myread
  950.         dflt=''
  951.         case "$ans" in
  952.         y*) cont='';;
  953.         esac
  954.     fi
  955.     fi
  956. done
  957.  
  958. # determine text processor flags to use.
  959. $cat <<EOM
  960.  
  961. If this text processor requires any options for proper formatting, specify
  962. them here.  To specify no options, enter the word "none".  Some versions
  963. of troff require the -t option to write to standard out.  This is the
  964. proper place to specify that option.
  965.  
  966. EOM
  967. dflt="$roffopts"
  968. rp="What options should Elm use with $roff: [$dflt]"
  969. $echo $n "$rp $c"
  970. . myread
  971. roffopts=$ans
  972. case "$roffopts" in
  973. 'none') roffopts=''
  974.      ;;
  975. esac
  976.  
  977. : determine where manual pages go
  978. $cat <<EOM
  979.   
  980. $package has manual pages that can be installed in unformatted or formatted form.
  981. Either or both (or neither) of these may be installed. 
  982.  
  983. Please give the location in which to store each type of man page. 
  984. To specify that a particular type is not to be installed, answer "none"
  985. to the question.
  986.  
  987. EOM
  988. case "$mansrc" in
  989. '')
  990.     dflt="/usr/man/mann /usr/man/manl /usr/man/man.L /usr/man/local/man1"
  991.     dflt="$dflt /usr/man/l_man/man1 /usr/local/man/u_man/man1"
  992.     dflt="$dflt /usr/local/man/l_man/man1 /usr/man/man1 /usr/man/u_man/man1"
  993.     dflt="$dflt /usr/share/man/man1 /usr/share/man/manl"
  994.     dflt=`loc . none $dflt`
  995.     ;;
  996. *)  dflt="$mansrc"
  997.     ;;
  998. esac
  999. cont=true
  1000. while $test "$cont" ; do
  1001.     echo " "
  1002.     rp="Where do the unformatted manual pages go? [$dflt]"
  1003.     $echo $n "$rp $c"
  1004.     . myread
  1005.     mansrc=`filexp "$ans"`
  1006.     if $test "$mansrc" = none -o -d "$mansrc"; then
  1007.     cont=''
  1008.     else
  1009.     if $test "$fastread" = yes; then
  1010.         dflt=y
  1011.     else
  1012.         dflt=n
  1013.     fi
  1014.     rp="Directory $mansrc doesn't exist.  Use that name anyway? [$dflt]"
  1015.     $echo $n "$rp $c"
  1016.     . myread
  1017.     dflt=''
  1018.     case "$ans" in
  1019.     y*) cont='';;
  1020.     esac
  1021.     fi
  1022. done
  1023.  
  1024. # determine the extension for man pages
  1025. if $test "$mansrc" != none ; then
  1026.     case "$manext" in
  1027.     '')
  1028.     if $test "$manext_choice" = none; then
  1029.         dflt=none
  1030.     else
  1031.         case "$mansrc" in
  1032.         *l) dflt=.l ;;
  1033.         *n) dflt=.n ;;
  1034.         *L) dflt=.L ;;
  1035.         *)  dflt=.1 ;;
  1036.         esac
  1037.     fi
  1038.     ;;
  1039.     .*)    dflt="$manext";;
  1040.     *)  dflt=".$manext";;
  1041.     esac
  1042.  
  1043.     $cat <<EOM
  1044.  
  1045. The installed unformatted manual pages can have various extensions to suit the
  1046. conventions of the host operating system, for example "page.1".
  1047.  
  1048. Note that the period '.' must be included as part of the extension.
  1049.  
  1050. To specify no extension, enter the word "none".
  1051.  
  1052. EOM
  1053.     rp="What extension should be used on installed unformatted man pages: [$dflt]"
  1054.     $echo $n "$rp $c"
  1055.     . myread
  1056.     manext=$ans
  1057.     manext_choice=$ans
  1058.     case "$manext" in
  1059.     'none')
  1060.     manext=''
  1061.     ;;
  1062.     esac
  1063.     fi
  1064.  
  1065. # Now the formatted man pages ala System V
  1066. case "$catmansrc" in
  1067. '')
  1068.     dflt="/usr/man/catn /usr/man/catl /usr/catman/man.L /usr/catman/local/man1"
  1069.     dflt="$dflt /usr/local/catman/u_man/man1 /usr/local/catman/l_man/man1"
  1070.     dflt="$dflt /usr/catman/l_man/man1 /usr/man/cat1 /usr/catman/man1"
  1071.     dflt="$dflt /usr/catman/u_man/man1 /usr/catman/URM/g1"
  1072.     dflt="$dflt /usr/share/man/cat1 /usr/share/man/catl"
  1073.     dflt=`loc . none $dflt`
  1074.     ;;
  1075. *)  dflt="$catmansrc"
  1076.     ;;
  1077. esac
  1078. cont=true
  1079. while $test "$cont" ; do
  1080.     echo " "
  1081.     rp="Where do the formatted manual pages go? [$dflt]"
  1082.     $echo $n "$rp $c"
  1083.     . myread
  1084.     catmansrc=`filexp "$ans"`
  1085.     if $test "$catmansrc" = none -o -d "$catmansrc"; then
  1086.     cont=''
  1087.     else
  1088.     if $test "$fastread" = yes; then
  1089.         dflt=y
  1090.     else
  1091.         dflt=n
  1092.     fi
  1093.     rp="Directory $catmansrc doesn't exist.  Use that name anyway? [$dflt]"
  1094.     $echo $n "$rp $c"
  1095.     . myread
  1096.     dflt=''
  1097.     case "$ans" in
  1098.     y*) cont='';;
  1099.     esac
  1100.     fi
  1101. done
  1102.  
  1103. # if installing formatted manual pages, determine a number of other things.
  1104. if $test "$catmansrc" != none ; then
  1105. #       determine text processor to use, default to nroff if found.
  1106.     case "$manroff" in
  1107.     '')
  1108.     if $test -n "$nroff"; then
  1109.         dflt="$nroff"
  1110.     else
  1111.         dflt=$troff
  1112.     fi
  1113.     ;;
  1114.     *)  dflt="$manroff";;
  1115.     esac
  1116.     $cat <<EOM
  1117.  
  1118. Online manual pages are generally formatted with nroff.  If you use an 
  1119. alternate text processor for on-line manual pages it can be specified here. 
  1120. Elm expects the text processor to write to standard out.
  1121.  
  1122. Note: This does not effect the formatter previously chosen for the Elm
  1123.       Elm documentation (Reference Guide, Configuration Guide, etc.).
  1124.  
  1125. EOM
  1126.     cont=true
  1127.     while $test "$cont" ; do
  1128.     echo " "
  1129.     echo "Give the name of the program used to format on-line manual pages"
  1130.     $echo $n "on your system: [$dflt] $c"
  1131.     rp="Preferred manual page formatter: [$dflt]"
  1132.     . myread
  1133.     manroff=$ans;
  1134.     if $test -f "$ans"; then
  1135.         cont=''
  1136.     else
  1137.         lookup=`loc "$ans" "" . $pth`
  1138.         if $test -f "$lookup"; then
  1139.         cont=''
  1140.         manroff=$lookup
  1141.         else
  1142.         if $test "$fastread" = yes; then
  1143.             dflt=y
  1144.           else
  1145.               dflt=n
  1146.           fi
  1147.         echo "Text processor $ans doesn't exist."
  1148.         rp="Use that name anyway? [$dflt]"
  1149.         $echo $n "$rp $c"
  1150.         . myread
  1151.         dflt=''
  1152.         case "$ans" in
  1153.         y*) cont='';;
  1154.         esac
  1155.         fi
  1156.     fi
  1157.     done
  1158.  
  1159.     # determine text processor flags to use.
  1160.     $cat <<EOM
  1161.  
  1162. If this text processor requires any options for proper formatting, specify
  1163. then here.  To specify no options, enter the word "none".
  1164.  
  1165. EOM
  1166.     dflt="$manroffopts"
  1167.     rp="What options should Elm use with $manroff: [$dflt]"
  1168.     $echo $n "$rp $c"
  1169.     . myread
  1170.     manroffopts=$ans
  1171.     case "$manroffopts" in
  1172.     'none') manroffopts=''
  1173.     ;;
  1174.     esac
  1175.  
  1176.     # determine the extension for catman pages
  1177.     case "$catmanext" in
  1178.     '')
  1179.     if $test "$catmanext_choice" = none; then
  1180.         dflt=none
  1181.     else
  1182.         case "$manext" in
  1183.         .*) dflt=$manext ;;
  1184.         *)
  1185.         if $test "$manext_choice" = none; then
  1186.             dflt=none
  1187.         else
  1188.                 case "$catmansrc" in
  1189.                 *l) dflt=.l ;;
  1190.                 *n) dflt=.n ;;
  1191.                 *L) dflt=.L ;;
  1192.                 *g1) dflt=none ;;
  1193.                 *)  dflt=.1 ;;
  1194.                 esac
  1195.         fi
  1196.         esac
  1197.     fi
  1198.     ;;
  1199.     .*)    dflt="$catmanext";;
  1200.     *)  dflt=".$catmanext";;
  1201.     esac
  1202.  
  1203.     $cat <<EOM
  1204.  
  1205. The installed formatted manual pages can have various extensions to suit the
  1206. conventions of the host operating system, for example "page.1".
  1207.  
  1208. Note that the period '.' must be included as part of the extension.
  1209.  
  1210. To specify no extension, enter the word "none".
  1211.  
  1212. EOM
  1213.     rp="What extension should be used on installed formatted man pages: [$dflt]"
  1214.     $echo $n "$rp $c"
  1215.     . myread
  1216.     catmanext=$ans
  1217.     catmanext_choice=$ans
  1218.     case "$catmanext" in
  1219.     'none')
  1220.     catmanext=''
  1221.     ;;
  1222.     esac
  1223.  
  1224.     if $test -f $pack -o -f $compress ; then
  1225. #    See if the formatted manual pages are to be packed or compressed
  1226.     if $test -f $pack; then
  1227.         $cat <<EOM
  1228.  
  1229. The formatted manual pages may be packed (.z suffix) or compressed (.Z
  1230. suffix) or left unpacked on your system.  The next two questions will deal
  1231. with how you want the formatted manual pages installed.  Answering no to
  1232. both packed and compressed will leave them unpacked.  Only one of packed
  1233. or compressed can be chosen.
  1234.  
  1235. EOM
  1236.         case "$suffix" in
  1237.         .Z) dflt=n;;
  1238.         .z) dflt=y;;
  1239.         *)  if [ "$catmansrc/*.z" != "`$echo $catmansrc/*.z`" ]; then
  1240.             dflt=y
  1241.         else
  1242.             dflt=n
  1243.         fi ;;
  1244.         esac
  1245.         rp="Should the formatted manual pages be packed? [$dflt]"
  1246.         $echo $n "$rp $c"
  1247.         . myread
  1248.         case "$ans" in
  1249.         y*) packed=y
  1250.         suffix=.z
  1251.         packer="$pack -f" ;;
  1252.         *)  packed=n ;;
  1253.         esac
  1254.     fi
  1255.  
  1256.     if $test -f $compress -a "$suffix" != ".z" ; then
  1257.         case "$suffix" in
  1258.         .z) dflt=n;;
  1259.         .Z) dflt=y;;
  1260.         *)  if [ "$catmansrc/*.Z" != "`$echo $catmansrc/*.Z`" ]; then
  1261.             dflt=y
  1262.         else
  1263.             dflt=n
  1264.         fi ;;
  1265.         esac
  1266.         rp="Should the formatted manual pages be compressed? [$dflt]"
  1267.         $echo $n "$rp $c"
  1268.         . myread
  1269.         case "$ans" in
  1270.         y*) packed=y
  1271.         suffix=.Z
  1272.         packer="$compress" ;;
  1273.         *)  packed=n ;;
  1274.         esac
  1275.     fi
  1276.  
  1277.     if $test "$packed" = 'n' ; then
  1278.         suffix=''
  1279.         packer=''
  1280.     fi
  1281.     else
  1282.     packed=''
  1283.     suffix=''
  1284.     packer=''
  1285.     fi
  1286.  
  1287. fi
  1288.  
  1289. : default clear to no extra flags
  1290. xencf=
  1291. xenlf=
  1292. d_xenix="$undef"
  1293. d_bsd="$undef"
  1294. : see if we are xenix 
  1295. if xenix; then
  1296.     d_xenix="$define"
  1297. :    now are we a 286
  1298.     case "`$uname -p`" in
  1299.     i80286) 
  1300.         xencf="-LARGE -Ml2et32"
  1301.         xenlf="-Ml2t32 -F 5600 -SEG 512"
  1302.       esac
  1303. fi
  1304. if bsd; then
  1305.     d_bsd="$define"
  1306. fi
  1307.  
  1308. : find out how to find out full name
  1309. echo " "
  1310. case "$d_berknames" in
  1311. "$define")
  1312.     dflt=y;;
  1313. "$undef")
  1314.     dflt=n;;
  1315. *)
  1316.     if bsd; then
  1317.     dflt=y
  1318.     elif xenix; then
  1319.     dflt=y
  1320.     else
  1321.     dflt=n
  1322.     fi
  1323.     ;;
  1324. esac
  1325. echo "Does your /etc/passwd file keep full names in Berkeley/V7 format (name first"
  1326. $echo $n "thing after ':' in GCOS field)? [$dflt] $c"
  1327. rp="Berkeley/V7 format full name? [$dflt]"
  1328. . myread
  1329. case "$ans" in
  1330.   y*)
  1331.     d_passnames="$define"
  1332.     d_berknames="$define"
  1333.     d_usgnames="$undef"
  1334.     nametype=bsd
  1335.     ;;
  1336.   *)
  1337.     echo " "
  1338.     case "$d_usgnames" in
  1339.     "$define")
  1340.     dflt=y;;
  1341.     "$undef")
  1342.     dflt=n;;
  1343.     *)
  1344.     if usg; then
  1345.         dflt=y
  1346.     else
  1347.         dflt=n
  1348.     fi
  1349.     ;;
  1350.     esac
  1351.     echo "Does your passwd file keep full names in USG format (name sandwiched"
  1352.     $echo $n "between a '-' and a '(')? [$dflt] $c"
  1353.     rp="USG format full name? [$dflt]"
  1354.     . myread
  1355.     case "$ans" in
  1356.       n*)
  1357.     echo "Full name will be taken from ~/.fullname"
  1358.     d_passnames="$undef"
  1359.     d_berknames="$undef"
  1360.     d_usgnames="$undef"
  1361.     nametype=other
  1362.     ;;
  1363.       *)
  1364.     d_passnames="$define"
  1365.     d_berknames="$undef"
  1366.     d_usgnames="$define"
  1367.     nametype=usg
  1368.     ;;
  1369.     esac
  1370.     ;;
  1371. esac
  1372.  
  1373. : see if we have to deal with yellow pages, if so, put sun
  1374. : library first, as the yp password routines must override
  1375. : the c library ones
  1376. if $test -d /usr/etc/yp || $test -d /etc/yp; then
  1377.     if $test "$passcat" = "ypcat passwd"; then
  1378.     dflt=y
  1379.     elif $contains '^\+:' /etc/passwd; then
  1380.     dflt=y
  1381.     else
  1382.     dflt=n
  1383.     fi
  1384.     rp="Are you getting the passwd file via yellow pages? [$dflt]"
  1385.     $echo $n "$rp $c"
  1386.     . myread
  1387.     case "$ans" in
  1388.     y*) passcat='ypcat passwd'
  1389.     case "$libswanted" in
  1390.     '') libswanted='sun c_s';;
  1391.     *)  libswanted=`$echo "$libswanted" | $sed -e 's/sun //g'`
  1392.         libswanted="sun $libswanted";;
  1393.     esac
  1394.     ;;
  1395.     *) passcat='cat /etc/passwd';;
  1396.     esac
  1397. else
  1398.     passcat='cat /etc/passwd'
  1399. fi
  1400.  
  1401. : see what memory models we can support
  1402. case "$models" in
  1403. '')
  1404.     : We may not use Cppsym or we get a circular dependency through cc.
  1405.     : But this should work regardless of which cc we eventually use.
  1406.     cat >pdp11.c <<'EOP'
  1407. main() {
  1408. #ifdef pdp11
  1409.     exit(0);
  1410. #else
  1411.     exit(1);
  1412. #endif
  1413. }
  1414. EOP
  1415.     cc -o pdp11 pdp11.c >/dev/null 2>&1
  1416.     if pdp11 2>/dev/null; then
  1417.     dflt='unsplit split'
  1418.     else
  1419.     ans=`loc . X /lib/small /lib/large /usr/lib/small /usr/lib/large /lib/medium /usr/lib/medium /lib/huge`
  1420.     case "$ans" in
  1421.     X) dflt='none';;
  1422.     *)  if $test -d /lib/small || $test -d /usr/lib/small; then
  1423.         dflt='small'
  1424.         else
  1425.         dflt=''
  1426.         fi
  1427.         if $test -d /lib/medium || $test -d /usr/lib/medium; then
  1428.         dflt="$dflt medium"
  1429.         fi
  1430.         if $test -d /lib/large || $test -d /usr/lib/large; then
  1431.         dflt="$dflt large"
  1432.         fi
  1433.         if $test -d /lib/huge || $test -d /usr/lib/huge; then
  1434.         dflt="$dflt huge"
  1435.         fi
  1436.     esac
  1437.     fi
  1438.     ;;
  1439. *)  dflt="$models" ;;
  1440. esac
  1441. if $test -z "$xencf" ; then
  1442. $cat <<EOM
  1443.  
  1444. Some systems have different model sizes.  On most systems they are called
  1445. small, medium, large, and huge.  On the PDP11 they are called unsplit and
  1446. split.  If your system doesn't support different memory models, say "none".
  1447. If you wish to force everything to one memory model, say "none" here and
  1448. put the appropriate flags later when it asks you for other cc and ld flags.
  1449. Xenix and Venix systems may wish to put "none" and let the compiler figure
  1450. things out.
  1451. (In the following question multiple model names should be space separated.)
  1452.  
  1453. EOM
  1454. rp="Which models are supported? [$dflt]"
  1455. $echo $n "$rp $c"
  1456. . myread
  1457. models="$ans"
  1458.  
  1459. case "$models" in
  1460. none)
  1461.     small=''
  1462.     medium=''
  1463.     large=''
  1464.     huge=''
  1465.     unsplit=''
  1466.     split=''
  1467.     ;;
  1468. *split)
  1469.     case "$split" in
  1470.     '') 
  1471.     if $contains '\-i' $mansrc/man1/ld.1 >/dev/null 2>&1 || \
  1472.        $contains '\-i' $mansrc/man1/cc.1 >/dev/null 2>&1; then
  1473.         dflt='-i'
  1474.     else
  1475.         dflt='none'
  1476.     fi
  1477.     ;;
  1478.     *) dflt="$split";;
  1479.     esac
  1480.     rp="What flag indicates separate I and D space? [$dflt]"
  1481.     $echo $n "$rp $c"
  1482.     . myread
  1483.     case "$ans" in
  1484.     none) ans='';;
  1485.     esac
  1486.     split="$ans"
  1487.     unsplit=''
  1488.     ;;
  1489. *large*|*small*|*medium*|*huge*)
  1490.     case "$models" in
  1491.     *large*)
  1492.     case "$large" in
  1493.     '') dflt='-Ml';;
  1494.     *) dflt="$large";;
  1495.     esac
  1496.     rp="What flag indicates large model? [$dflt]"
  1497.     $echo $n "$rp $c"
  1498.     . myread
  1499.     case "$ans" in
  1500.     none) ans='';
  1501.     esac
  1502.     large="$ans"
  1503.     ;;
  1504.     *) large='';;
  1505.     esac
  1506.     case "$models" in
  1507.     *huge*)
  1508.     case "$huge" in
  1509.     '') dflt='-Mh';;
  1510.     *) dflt="$huge";;
  1511.     esac
  1512.     rp="What flag indicates huge model? [$dflt]"
  1513.     $echo $n "$rp $c"
  1514.     . myread
  1515.     case "$ans" in
  1516.     none) ans='';
  1517.     esac
  1518.     huge="$ans"
  1519.     ;;
  1520.     *) huge="$large";;
  1521.     esac
  1522.     case "$models" in
  1523.     *medium*)
  1524.     case "$medium" in
  1525.     '') dflt='-Mm';;
  1526.     *) dflt="$medium";;
  1527.     esac
  1528.     rp="What flag indicates medium model? [$dflt]"
  1529.     $echo $n "$rp $c"
  1530.     . myread
  1531.     case "$ans" in
  1532.     none) ans='';
  1533.     esac
  1534.     medium="$ans"
  1535.     ;;
  1536.     *) medium="$large";;
  1537.     esac
  1538.     case "$models" in
  1539.     *small*)
  1540.     case "$small" in
  1541.     '') dflt='none';;
  1542.     *) dflt="$small";;
  1543.     esac
  1544.     rp="What flag indicates small model? [$dflt]"
  1545.     $echo $n "$rp $c"
  1546.     . myread
  1547.     case "$ans" in
  1548.     none) ans='';
  1549.     esac
  1550.     small="$ans"
  1551.     ;;
  1552.     *) small='';;
  1553.     esac
  1554.     ;;
  1555. *)
  1556.     echo "Unrecognized memory models--you may have to edit Makefile.SH"
  1557.     ;;
  1558. esac
  1559. fi
  1560.  
  1561. : see if we need a special compiler
  1562. echo " "
  1563. if usg; then
  1564.     case "$cc" in
  1565.     '')
  1566.     case "$Mcc" in
  1567.     /*) dflt='Mcc'
  1568.         ;;
  1569.     *)
  1570.         case "$large" in
  1571.         -M*)
  1572.         dflt='cc'
  1573.         ;;
  1574.         *)
  1575.         if $contains '\-M' $mansrc/cc.1 >/dev/null 2>&1 ; then
  1576.             dflt='cc -M'
  1577.         else
  1578.             dflt='cc'
  1579.         fi
  1580.         ;;
  1581.         esac
  1582.         ;;
  1583.     esac
  1584.     ;;
  1585.     *)  dflt="$cc";;
  1586.     esac
  1587.     $cat <<'EOM'
  1588.   
  1589. On some systems the default C compiler will not resolve multiple global
  1590. references that happen to have the same name.  On some such systems the
  1591. "Mcc" command may be used to force these to be resolved.  On other systems
  1592. a "cc -M" command is required.  (Note that the -M flag on other systems
  1593. indicates a memory model to use!)  If you have the Gnu C compiler, you
  1594. might wish to use that instead.  What command will force resolution on
  1595. EOM
  1596.     $echo $n "this system? [$dflt] $c"
  1597.     rp="Command to resolve multiple refs? [$dflt]"
  1598.     . myread
  1599.     cc="$ans"
  1600. else
  1601.     case "$cc" in
  1602.     '') dflt=cc;;
  1603.     *) dflt="$cc";;
  1604.     esac
  1605.     rp="Use which C compiler? [$dflt]"
  1606.     $echo $n "$rp $c"
  1607.     . myread
  1608.     cc="$ans"
  1609. fi
  1610. case "$cc" in
  1611. gcc*) cpp=`loc gcc-cpp $cpp $pth`;;
  1612. esac
  1613.  
  1614. : determine optimize, if desired, or use for debug flag also
  1615. case "$optimize" in
  1616. ' ') dflt="none"
  1617.      ;;
  1618. '') dflt="-O";
  1619.     ;;
  1620. *)  dflt="$optimize"
  1621.     ;;
  1622. esac
  1623. cat <<EOH
  1624.  
  1625. Some C compilers have problems with their optimizers, by default, $package
  1626. compiles with the -O flag to use the optimizer.  Alternately, you might
  1627. want to use the symbolic debugger, which uses the -g flag (on traditional
  1628. UNIX systems).  Either flag can be specified here.  To use neither flag,
  1629. specify the word "none".
  1630.   
  1631. EOH
  1632. rp="What optimizer/debugger flag should be used? [$dflt]"
  1633. $echo $n "$rp $c"
  1634. . myread
  1635. optimize="$ans"
  1636. case "$optimize" in
  1637. 'none') optimize=" "
  1638.      ;;
  1639. esac
  1640.  
  1641. case "$ccflags" in
  1642. '') case "$cc" in
  1643.     *gcc*) dflt='-fpcc-struct-return -traditional';;
  1644.     *) dflt='';;
  1645.     esac
  1646.     ;;
  1647. *) dflt="$ccflags";;
  1648. esac
  1649. for thisincl in $inclwanted; do
  1650.     if test -d $thisincl; then
  1651.     case "$dflt" in
  1652.     *$thisincl*);;
  1653.     *) dflt="$dflt -I$thisincl";;
  1654.     esac
  1655.     fi
  1656. done
  1657. case "$optimize" in
  1658. -g*)
  1659.     case "$dflt" in
  1660.     *DEBUG*);;
  1661.     *) dflt="$dflt -DDEBUG";;
  1662.     esac
  1663.     ;;
  1664. esac
  1665. case "$dflt" in
  1666. '') dflt=none;;
  1667. esac
  1668. if $test -n "$xencf" ; then
  1669.     $echo "Xenix 286 system, using compiler flags $xencf"
  1670.     $echo "do not respecify these flags below."
  1671.     $echo ""
  1672. fi
  1673. cat <<EOH
  1674.  
  1675. Your C compiler may want other flags.  For this question you should
  1676. include -I/whatever and -DWHATEVER flags and any other flags used by
  1677. the C compiler, but you should NOT include libraries or ld flags like
  1678. -lwhatever.  To use no flags, specify the word "none".
  1679.   
  1680. EOH
  1681. rp="Any additional cc flags? [$dflt]"
  1682. $echo $n "$rp $c"
  1683. . myread
  1684. case "$ans" in
  1685. none) ans='';
  1686. esac
  1687. ccflags="$ans"
  1688.  
  1689. : the following weeds options from ccflags that are of no interest to cpp
  1690. cppflags="$ccflags"
  1691. case "$cc" in
  1692. *gcc*) cppflags="$cppflags -D__GNUC__";;
  1693. esac
  1694. case "$cppflags" in
  1695. '');;
  1696. *)  set X $cppflags
  1697.     cppflags=''
  1698.     for flag do
  1699.     case $flag in
  1700.     -D*|-I*|-U*) cppflags="$cppflags $flag";;
  1701.     esac
  1702.     done
  1703.     case "$cppflags" in
  1704.     *-*)  echo "(C preprocessor flags: $cppflags)";;
  1705.     esac
  1706.     ;;
  1707. esac
  1708.  
  1709. if $test -n "$xenlf" ; then
  1710.     $echo "Xenix 286 system, using linker flags $xenlf"
  1711.     $echo "do not respecify these flags below"
  1712.     $echo ""
  1713. fi
  1714. case "$ldflags" in
  1715. '') if venix; then
  1716.     dflt='-i -z'
  1717.     else
  1718.     dflt='none'
  1719.     fi
  1720.     ;;
  1721. *) dflt="$ldflags";;
  1722. esac
  1723. cat <<EOH
  1724.  
  1725. Your linker/loader may want other flags.  For example, you might
  1726. want to enable support for the symbolic debugger (-g on traditional
  1727. UNIX systems).  For this question you should specify those flags.
  1728. Do NOT specify libraries (-lwhatever) here.  Most systems will not
  1729. need any special flags, in which case specify "none".
  1730.  
  1731. EOH
  1732. rp="Any additional ld flags (NOT including libraries)? [$dflt]"
  1733. $echo $n "$rp $c"
  1734. . myread
  1735. case "$ans" in
  1736. none) ans='';
  1737. esac
  1738. ldflags="$ans"
  1739. rmlist="$rmlist pdp11"
  1740.  
  1741. echo " "
  1742. echo "Checking for optional libraries..."
  1743. case "$libs" in
  1744. '') dflt='';;
  1745. *) dflt="$libs";;
  1746. esac
  1747. case "$libswanted" in
  1748. '') libswanted='c_s';;
  1749. esac
  1750. for thislib in $libswanted; do
  1751.     case "$thislib" in
  1752.     dbm) thatlib=ndbm;;
  1753.     *_s) thatlib=NONE;;
  1754.     *) thatlib="${thislib}_s";;
  1755.     *) thatlib=NONE;;
  1756.     esac
  1757.     xxx=`loc lib$thislib.a X /usr/lib /usr/ccs/lib /usr/local/lib /lib`
  1758.     if test -f $xxx; then
  1759.     echo "Found -l$thislib."
  1760.     case "$dflt" in
  1761.     *-l$thislib*|*-l$thatlib*);;
  1762.     *) dflt="$dflt -l$thislib";;
  1763.     esac
  1764.     else
  1765.     xxx=`loc lib$thislib.a X $libpth`
  1766.     if test -f $xxx; then
  1767.         echo "Found $xxx."
  1768.         case "$dflt" in
  1769.         *$xxx*);;
  1770.         *) dflt="$dflt $xxx";;
  1771.         esac
  1772.     else
  1773.         xxx=`loc Slib$thislib.a X $xlibpth`
  1774.         if test -f $xxx; then
  1775.         echo "Found -l$thislib."
  1776.         case "$dflt" in
  1777.         *-l$thislib*|*-l$thatlib*);;
  1778.         *) dflt="$dflt -l$thislib";;
  1779.         esac
  1780.         else
  1781.         echo "No -l$thislib."
  1782.         fi
  1783.     fi
  1784.     fi
  1785. done
  1786. set X $dflt
  1787. shift
  1788. dflt="$*"
  1789. case "$dflt" in
  1790. '') dflt='none';;
  1791. esac
  1792.  
  1793. $cat <<EOM
  1794.  
  1795. Some versions of UNIX support shared libraries, which make
  1796. executables smaller but make load time slightly longer.
  1797.  
  1798. On some systems, mostly newer UNIX System V's, the shared library
  1799. is included by putting the option "-lc_s" as the last thing on the
  1800. cc command line when linking.  Other systems use shared libraries
  1801. by default.  There may be other libraries needed to compile $package
  1802. on your machine as well.  If your system needs the "-lc_s" option,
  1803. include it here.  Include any other special libraries here as well.
  1804. Say "none" for none.
  1805. EOM
  1806.  
  1807. echo " "
  1808. rp="Any additional libraries? [$dflt]"
  1809. $echo $n "$rp $c"
  1810. . myread
  1811. case "$ans" in
  1812. none) ans='';
  1813. esac
  1814. libs="$ans"
  1815.  
  1816. : check for "existence of altzone"
  1817. echo " "
  1818. case "$d_altcheck" in
  1819. "$define")    ;;
  1820. "$undef")    ;;
  1821. *)
  1822.         echo "Checking to see if altzone exists as a global variable works..."
  1823.         $rm -f try try.o
  1824.         $cat >try.c <<'EOCP'
  1825.  
  1826. main()
  1827.     {
  1828.     long    t;
  1829.     extern    long    altzone;
  1830.  
  1831.     t = altzone;
  1832.  
  1833.     exit(0);
  1834.     }
  1835. EOCP
  1836.         if $cc try.c -o try >/dev/null 2>&1 ; then
  1837.         d_altcheck="$define"
  1838.         echo "Your system supports altzone..."
  1839.         else
  1840.         d_altcheck="$undef"
  1841.         echo "Your system does not support altzone..."
  1842.         fi
  1843.         $rm -f try.c try.o try
  1844.     ;;
  1845. esac
  1846.  
  1847. : check to see if the macros are 8-bit clean, ask the user
  1848. :
  1849. $cat <<EOM
  1850.  
  1851.  
  1852. Not all environments are restricted to the ASCII 7-bit character set.
  1853. For example, the ISO 8859/1 (Latin alphabet no. 1) character set,
  1854. consisting of 8 bits and 191 printable characters, is becoming
  1855. more and more common, especially in non-English speaking countries.
  1856.  
  1857. Unfortunately, not all isprint() functions or macros, which ELM
  1858. uses to determine whether a character is printable or not, will
  1859. handle non-ASCII (8-bit) characters properly.  It is suggested that you
  1860. start with this value configured to handle 8-bit characters correctly
  1861. and if there are problems with Elm aborting while displaying messages
  1862. that use extended character sets to reconfigure Elm to only display
  1863. 7-bit characters.
  1864.  
  1865. EOM
  1866.  
  1867. case "$d_ascii" in
  1868.     "$define")   dflt='n';;
  1869.     *)  dflt='y';;
  1870. esac
  1871.  
  1872. echo "  "
  1873. rp="Should Elm assume that isprint() won't break on non-ASCII characters? [$dflt]"
  1874. $echo $n "$rp $c"
  1875. . myread
  1876. case "$ans" in
  1877.     y*) d_ascii="$undef";;
  1878.     *) d_ascii="$define";;
  1879. esac
  1880.  
  1881.  
  1882. case "$d_content" in
  1883. "$define") dflt=y;;
  1884. "$undef")  dflt=n;;
  1885. *)       dflt=n;;
  1886. esac
  1887.  
  1888. $cat << EOM
  1889.  
  1890. Some modern Mail Transport Agents (mailers) support the Content-Length: header.
  1891. In doing so, they do not wish to have messages escaped to protect 'From ' lines
  1892. in the body of the message, among other strings.  Does the Mail Transport Agent
  1893. in use on this system honor the Content-Length: header?
  1894. EOM
  1895.  
  1896. echo " "
  1897. rp="Honors Content-Length: header? [$dflt]"
  1898. $echo $n "$rp $c"
  1899. . myread
  1900. case "$ans" in
  1901. y*) d_content="$define";;
  1902. *)  d_content="$undef";;
  1903. esac
  1904.  
  1905. : get list of predefined functions in a handy place
  1906. echo " "
  1907. case "$libc" in
  1908. '') if test -d /usr/apollo; then
  1909.     libc=/lib/libc
  1910.     else
  1911.     libc=unknown
  1912.     fi
  1913.     ;;
  1914. '/lib/libc /lib/clib')
  1915.     libc=/lib/libc
  1916.     ;;
  1917. esac
  1918. case "$mips" in
  1919. '') mips=false;;
  1920. 'mips') mips=false;;
  1921. esac
  1922. case "$nm_opts" in
  1923. '') if test -f /mach_boot; then
  1924.     nm_opts=''
  1925.     elif test -d /usr/ccs/lib; then
  1926.     nm_opts='-p'
  1927.     elif "$mips"; then
  1928.     nm_opts='-B'
  1929.     else
  1930.     nm_opts=''
  1931.     fi
  1932.     ;;
  1933. esac
  1934. : on mips, we DO NOT want /lib, and we want inclPath/usr/lib
  1935. case "$libpth" in
  1936. '') if "$mips"; then
  1937.     libpth='$inclPath/usr/lib /usr/local/lib'
  1938.     nm_opts='-B'
  1939.     else
  1940.     libpth='/usr/ccs/lib /lib /usr/lib /usr/ucblib /usr/local/lib'
  1941.     fi
  1942.     ;;
  1943. esac
  1944. case "$libs" in
  1945. *-lc_s*) libc=`./loc libc_s.a $libc $libpth`
  1946. esac
  1947. libnames='';
  1948. case "$libs" in
  1949. '') ;;
  1950. *)  for thislib in $libs; do
  1951.     case "$thislib" in
  1952.     -l*) thislib=`expr X$thislib : 'X-l\(.*\)'`
  1953.         try=`./loc lib$thislib.a blurfl/dyick $libpth`
  1954.         if test ! -f $try; then
  1955.         try=`./loc lib$thislib blurfl/dyick $libpth`
  1956.         if test ! -f $try; then
  1957.             try=`./loc $thislib blurfl/dyick $libpth`
  1958.             if test ! -f $try; then
  1959.             try=`./loc Slib$thislib.a blurfl/dyick $xlibpth`
  1960.             if test ! -f $try; then
  1961.                 try=''
  1962.             fi
  1963.             fi
  1964.         fi
  1965.         fi
  1966.         libnames="$libnames $try"
  1967.         ;;
  1968.     *) libnames="$libnames $thislib" ;;
  1969.     esac
  1970.     done
  1971.     ;;
  1972. esac
  1973. set /usr/ccs/lib/libc.so
  1974. test -f $1 || set /usr/lib/libc.so
  1975. test -f $1 || set /usr/lib/libc.so.[0-9]*
  1976. test -f $1 || set /lib/libsys_s.a
  1977. eval set \$$#
  1978. if test -f "$1"; then
  1979.     echo "Your shared C library is in $1."
  1980.     libc="$1"
  1981. elif test -f "$libc"; then
  1982.     echo "Your C library is in $libc."
  1983. elif test -f /lib/libc.a; then
  1984.     echo "Your C library is in /lib/libc.a.  You're normal."
  1985.     libc=/lib/libc.a
  1986. else
  1987.     if   ans=`./loc libc.a  blurfl/dyick $libpth`; test -f "$ans"; then
  1988.     :
  1989.     elif ans=`./loc libc    blurfl/dyick $libpth`; test -f "$ans"; then
  1990.         libnames="$libnames "`./loc clib blurfl/dyick $libpth`
  1991.     elif ans=`./loc clib    blurfl/dyick $libpth`; test -f "$ans"; then
  1992.     :
  1993.     elif ans=`./loc Slibc.a blurfl/dyick $xlibpth`; test -f "$ans"; then
  1994.     :
  1995.     elif ans=`./loc Mlibc.a blurfl/dyick $xlibpth`; test -f "$ans"; then
  1996.     :
  1997.     elif ans=`./loc Llibc.a blurfl/dyick $xlibpth`; test -f "$ans"; then
  1998.     :
  1999.     fi
  2000.     if test -f "$ans"; then
  2001.     echo "Your C library is in $ans, of all places."
  2002.     libc=$ans
  2003.     else
  2004.     cat <<EOM
  2005.  
  2006. I can't seem to find your C library.  I've looked in the following places:
  2007.  
  2008.     $libpth
  2009.  
  2010. None of these seems to contain your C library.  What is the full name
  2011. EOM
  2012.     dflt=None
  2013.     $echo $n "of your C library? $c"
  2014.     rp='C library full name?'
  2015.     . myread
  2016.     libc="$ans"
  2017.     fi
  2018. fi
  2019. echo " "
  2020. if test $libc = "/lib/libc"; then
  2021.     libc="$libc /lib/clib"
  2022. fi
  2023. set `echo $libc $libnames | tr ' ' '\012' | sort | uniq`
  2024. $echo $n "Extracting names from $* for later perusal...$c"
  2025. nm $nm_opts $* 2>/dev/null >libc.tmp
  2026. $sed -n -e 's/^.* [ATDS]  *[_.]*//p' -e 's/^.* [ATDS] //p' <libc.tmp >libc.list
  2027. if $contains '^printf$' libc.list >/dev/null 2>&1; then
  2028.     echo done
  2029. elif $sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p' \
  2030.     <libc.tmp >libc.list; \
  2031.   $contains '^printf$' libc.list >/dev/null 2>&1; then
  2032.     echo done
  2033. elif $sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p' <libc.tmp >libc.list; \
  2034.   $contains '^printf$' libc.list >/dev/null 2>&1; then
  2035.     echo done
  2036. elif $sed -n -e 's/^.* D __*//p' -e 's/^.* D //p' <libc.tmp >libc.list; \
  2037.   $contains '^printf$' libc.list >/dev/null 2>&1; then
  2038.     echo done
  2039. elif $sed -n -e 's/^_//' -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p' \
  2040.         <libc.tmp >libc.list; \
  2041.   $contains '^printf$' libc.list >/dev/null 2>&1; then
  2042.     echo done
  2043. elif $grep '|' <libc.tmp | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \
  2044.                                    -e 's/^\([^     ]*\).*/\1/p' >libc.list
  2045.   $contains '^printf$' libc.list >/dev/null 2>&1; then
  2046.     echo done
  2047. elif $sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p' \
  2048.        <libc.tmp >libc.list; \
  2049.   $contains '^printf$' libc.list >/dev/null 2>&1; then
  2050.     echo done
  2051. else
  2052.     nm -p $* 2>/dev/null >libc.tmp
  2053.     $sed -n -e 's/^.* [AT]  *_[_.]*//p' -e 's/^.* [AT] //p' <libc.tmp >libc.list
  2054.     if $contains '^printf$' libc.list >/dev/null 2>&1; then
  2055.     nm_opts='-p'
  2056.     echo "done"
  2057.     else
  2058.     echo " "
  2059.     echo "nm didn't seem to work right."
  2060.     echo "Trying ar instead..."
  2061.     if ar t $libc > libc.tmp; then
  2062.         for thisname in $libnames; do
  2063.         ar t $thisname >>libc.tmp
  2064.         done
  2065.         $sed -e 's/\.o$//' < libc.tmp > libc.list
  2066.         echo "Ok."
  2067.     else
  2068.         echo "ar didn't seem to work right."
  2069.         echo "Maybe this is a Cray...trying bld instead..."
  2070.         if bld t $libc | $sed -e 's/.*\///' -e 's/\.o:.*$//' > libc.list; then
  2071.         for thisname in $libnames; do
  2072.             bld t $libnames | \
  2073.             $sed -e 's/.*\///' -e 's/\.o:.*$//' >>libc.list
  2074.             ar t $thisname >>libc.tmp
  2075.         done
  2076.         echo "Ok."
  2077.         else
  2078.         echo "That didn't work either.  Giving up."
  2079.         exit 1
  2080.         fi
  2081.     fi
  2082.     fi
  2083. fi
  2084.  
  2085. : old version
  2086.  
  2087. inlibc='echo " ";
  2088. if $contains "^$1\$" libc.list >/dev/null 2>&1;
  2089. then echo "$1() found"; eval "$2=$define";
  2090. else echo "$1() not found"; eval "$2=$undef"; fi'
  2091.  
  2092. : : new version
  2093. : inlibc='echo " "; td=$define; tu=$undef;
  2094. : if $contains "^$1\$" libc.list >/dev/null 2>&1;
  2095. : then echo "$1() found";
  2096. :   eval "case \"\$$2\" in undef) . whoa; esac"; eval "$2=\$td";
  2097. : else echo "$1() not found";
  2098. :   eval "case \"\$$2\" in define) . whoa; esac"; eval "$2=\$tu"; fi'
  2099. : rmlist="$rmlist libc.tmp libc.list"
  2100. : see if crypt exists
  2101. echo " "
  2102. if $contains '^crypt$' libc.list >/dev/null 2>&1; then
  2103.     echo 'crypt() found.'
  2104.     d_crypt="$define"
  2105.     cryptlib=''
  2106. else
  2107.     cryptlib=`loc Slibcrypt.a "" $xlibpth`
  2108.     if $test -z "$cryptlib"; then
  2109.     cryptlib=`loc Mlibcrypt.a "" $xlibpth`
  2110.     else
  2111.     cryptlib=-lcrypt
  2112.     fi
  2113.     if $test -z "$cryptlib"; then
  2114.     cryptlib=`loc Llibcrypt.a "" $xlibpth`
  2115.     else
  2116.     cryptlib=-lcrypt
  2117.     fi
  2118.     if $test -z "$cryptlib"; then
  2119.     cryptlib=`loc libcrypt.a "" $libpth`
  2120.     else
  2121.     cryptlib=-lcrypt
  2122.     fi
  2123. #
  2124. #    now try for international versions?
  2125. #
  2126.     if $test -z "$cryptlib"; then
  2127.     cryptlib=`loc Slibcrypt_i.a "" $libpth`
  2128.     if $test -z "$cryptlib"; then
  2129.         cryptlib=`loc Mlibcrypt_i.a "" $libpth`
  2130.     else
  2131.         cryptlib=-lcrypt_i
  2132.     fi
  2133.     if $test -z "$cryptlib"; then
  2134.         cryptlib=`loc Llibcrypt_i.a "" $libpth`
  2135.     else
  2136.         cryptlib=-lcrypt_i
  2137.     fi
  2138.     if $test -z "$cryptlib"; then
  2139.         cryptlib=`loc libcrypt_i.a "" $libpth`
  2140.     else
  2141.         cryptlib=-lcrypt_i
  2142.     fi
  2143.     fi
  2144.     if $test -z "$cryptlib"; then
  2145.     echo 'crypt() not found.'
  2146.     d_crypt="$undef"
  2147.     else
  2148.     d_crypt="$define"
  2149.     fi
  2150. fi
  2151.  
  2152. : check for cuserid function
  2153. set cuserid d_cuserid
  2154. eval $inlibc
  2155.  
  2156. : determine if the host name should be displayed on the index page
  2157.  
  2158. case "$d_disphost" in
  2159. "$define") dflt=y;;
  2160. "$undef")  dflt=n;;
  2161. *)    dflt=n;;
  2162. esac
  2163. $cat <<EOM
  2164.  
  2165. Elm can either display the hostname on the index page, or just
  2166. the folder name.  If the hostname is displayed, the folder name
  2167. will read hostname:folder.  If not it will just read folder.
  2168.  
  2169. EOM
  2170. rp="Should Elm display the hostname as part of the folder name? [$dflt]"
  2171. $echo $n "$rp $c"
  2172. . myread
  2173. case "$ans" in
  2174. y*) d_disphost="$define";;
  2175. *)  d_disphost="$undef";;
  2176. esac
  2177.  
  2178.  
  2179. echo " "
  2180. if $contains flock libc.list >/dev/null 2>&1; then
  2181.     echo 'flock() found.'
  2182.     if $contains EWOULDBLOCK /usr/include/errno.h > /dev/null 2>&1; then
  2183.         has_flock="$define"
  2184.         echo 'flock locking available.'
  2185.     elif $contains EWOULDBLOCK /usr/include/sys/errno.h > /dev/null 2>&1; then
  2186.         has_flock="$define"
  2187.         echo 'flock locking available.'
  2188.     else
  2189.     has_flock="$undef"
  2190.         echo 'flock locking not available.'
  2191.     d_flock="$undef"
  2192.     fi
  2193. else
  2194.     has_flock="$undef"
  2195.     d_flock="$undef"
  2196. fi
  2197.  
  2198. if $contains F_SETLK /usr/include/sys/fcntl.h >/dev/null 2>&1; then
  2199.     echo 'F_SETLK found, fcntl locking available'
  2200.     has_fcntl="$define"
  2201. elif $contains F_SETLK /usr/include/sys/fcntlcom.h >/dev/null 2>&1; then
  2202.     echo 'F_SETLK found, fcntl locking available'
  2203.     has_fcntl="$define"
  2204. elif $contains F_SETLK /usr/include/sys/file.h >/dev/null 2>&1; then
  2205.     echo 'F_SETLK found, fcntl locking available'
  2206.     has_fcntl="$define"
  2207. elif $contains F_SETLK /usr/include/fcntl.h >/dev/null 2>&1; then
  2208.     echo 'F_SETLK found, fcntl locking available'
  2209.     has_fcntl="$define"
  2210. else
  2211.     echo 'F_SETLK not found, fcntl locking not available'
  2212.     has_fcntl="$undef"
  2213.     d_fcntlock="$undef"
  2214. fi
  2215.  
  2216. if $test "$has_flock" = "$define" -o "$has_fcntl" = "$define"; then
  2217.     $cat <<EOM
  2218. Mail Transport Agents (sendmail, etc.) and Mail User Agents (Elm) can
  2219. use a variety of file locking protocols.  Based on your system type,
  2220. usage of a network, and MTA/MUAs in use, you may want to configure more
  2221. than one of the following Mail Locking Protocols.  It is recommended
  2222. that you use as many as are possible on your system to avoid problems.
  2223. All systems can support the dot locking method (.lock files).
  2224.  
  2225. Available locking protocols:
  2226.     dot locking (.lock)
  2227. EOM
  2228.     if $test "$has_flock" = "$define"; then
  2229.     echo '    flock style locking'
  2230.     fi
  2231.  
  2232.     if $test "$has_fcntl" = "$define"; then
  2233.     echo '    fcntl style locking'
  2234.     fi
  2235.  
  2236.     if $test "$has_flock" = "$define" -a "$has_fcntl" = "$define"; then
  2237.     $cat <<EOM
  2238. On some systems, flock style locking and fcntl style locking use the
  2239. same underlying calls so both are not only not necessary, but may
  2240. interfere with each other.  On other systems they are distinct and both
  2241. should be used.  You will have to consult the documentation for your
  2242. operating system to determine in which class your system resides.
  2243.  
  2244. EOM
  2245.     fi
  2246.  
  2247.     case "$d_dotlock" in
  2248.     "$define")    dflt=y;;
  2249.     "$undef")    dflt=n;;
  2250.     *)        dflt=y;;
  2251.     esac
  2252.  
  2253.     rp="Would you like to use dot lock style mail spool locking? [$dflt]"
  2254.     $echo $n "$rp $c"
  2255.     . myread
  2256.     case "$ans" in
  2257.     y*) d_dotlock="$define";;
  2258.     *)  d_dotlock="$undef";;
  2259.     esac
  2260.  
  2261.     if $test "$has_flock" = "$define"; then
  2262.     case "$d_flock" in
  2263.     "$define")    dflt=y;;
  2264.     "$undef")    dflt=n;;
  2265.     *)        dflt=y;;
  2266.     esac
  2267.  
  2268.     rp="Would you like to use flock style mail spool locking? [$dflt]"
  2269.     $echo $n "$rp $c"
  2270.     . myread
  2271.     case "$ans" in
  2272.     y*) d_flock="$define";;
  2273.     *)  d_flock="$undef";;
  2274.     esac
  2275.     fi
  2276.  
  2277.     if $test "$has_fcntl" = "$define"; then
  2278.     case "$d_fcntlock" in
  2279.     "$define")    dflt=y;;
  2280.     "$undef")    dflt=n;;
  2281.     *)        dflt=y;;
  2282.     esac
  2283.  
  2284.     rp="Would you like to use fcntl style mail spool locking? [$dflt]"
  2285.     $echo $n "$rp $c"
  2286.     . myread
  2287.     case "$ans" in
  2288.     y*) d_fcntlock="$define";;
  2289.     *)  d_fcntlock="$undef";;
  2290.     esac
  2291.     fi
  2292. else
  2293.     d_dotlock="$define"
  2294.     echo 'Dot lock style locking will be used'
  2295. fi
  2296.  
  2297. if $test -d /usr/spool/locks ; then
  2298.     lock_dir=/usr/spool/locks
  2299. elif $test -d /usr/spool/uucp ; then
  2300.     lock_dir=/usr/spool/uucp
  2301. elif $test -d /var/spool/locks ; then
  2302.     lock_dir=/var/spool/locks
  2303. elif $test -d /var/spool/uucp ; then
  2304.     lock_dir=/var/spool/uucp
  2305. else
  2306.     lock_dir=/tmp
  2307. fi
  2308. echo " "
  2309. echo "Non-mailbox locks will use the $lock_dir directory"
  2310. echo " "
  2311.  
  2312. : now get the host name
  2313. if $test "$autohostname" != "$undef" -o "$hostname" = "" ; then
  2314.     autohostname="$define"
  2315.     echo " "
  2316.     echo "Figuring out host name..."
  2317.     echo 'Maybe "hostname" will work...'
  2318.     if ans=`sh -c hostname 2>&1` ; then
  2319.     hostname=$ans
  2320.     phostname=hostname
  2321.     else
  2322.     if xenix; then
  2323.         echo 'Oh, dear.  Maybe "/etc/systemid" is the key...'
  2324.         if ans=`cat /etc/systemid 2>&1` ; then
  2325.         hostname=$ans
  2326.         phostname='cat /etc/systemid'
  2327.         echo "Whadyaknow.  Xenix always was a bit strange..."
  2328.         else
  2329.         echo 'No, maybe "uuname -l" will work...'
  2330.         if ans=`sh -c '$uuname -l' 2>&1` ; then
  2331.             hostname=$ans
  2332.             phostname='$uuname -l'
  2333.         else
  2334.             echo 'Strange.  Maybe "uname -n" will work...'
  2335.             if ans=`sh -c '$uname -n' 2>&1` ; then
  2336.             hostname=$ans
  2337.             phostname='$uname -n'
  2338.             else
  2339.             echo 'Oh well, maybe I can mine it out of whoami.h...'
  2340.             if ans=`sh -c $contains' sysname /usr/include/whoami.h' 2>&1` ; then
  2341.                 hostname=`echo "$ans" | $sed 's/^.*"\(.*\)"/\1/'`
  2342.                 phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' </usr/include/whoami.h"
  2343.             else
  2344.                 case "$hostname" in
  2345.                 '') echo "Does this machine have an identity crisis or something?"
  2346.                 phostname=''
  2347.                 ;;
  2348.                 *)  echo "Well, you said $hostname before...";;
  2349.                 esac
  2350.             fi
  2351.             fi
  2352.         fi
  2353.         fi
  2354.     else
  2355.         if $test -r /etc/systemid ; then
  2356.         echo "What is a non-Xenix system doing with /etc/systemid?"
  2357.         fi
  2358.         echo 'No, maybe "uuname -l" will work...'
  2359.         if $test -n "$uuname" && ans=`sh -c "$uuname -l" 2>&1` ; then
  2360.         hostname=$ans
  2361.         phostname="$uuname -l"
  2362.         else
  2363.         echo 'Strange.  Maybe "uname -n" will work...'
  2364.         if $test -n "$uname" && ans=`sh -c "$uname -n" 2>&1` ; then
  2365.             hostname=$ans
  2366.             phostname="$uname -n"
  2367.         else
  2368.             if ans=`cat /etc/systemid 2>&1` ; then
  2369.             hostname=$ans
  2370.             phostname='cat /etc/systemid'
  2371.             echo "Well, I'll use the systemid file anyway..."
  2372.             else
  2373.             echo 'Oh well, maybe I can mine it out of whoami.h...'
  2374.             if ans=`sh -c $contains' sysname /usr/include/whoami.h' 2>&1` ; then
  2375.                 hostname=`echo "$ans" | $sed 's/^.*"\(.*\)"/\1/'`
  2376.                 phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' </usr/include/whoami.h"
  2377.             else
  2378.                 case "$hostname" in
  2379.                 '') echo "Does this machine have an identity crisis or something?"
  2380.                 phostname=''
  2381.                 ;;
  2382.                 *)  echo "Well, you said $hostname before...";;
  2383.                 esac
  2384.             fi
  2385.             fi
  2386.         fi
  2387.         fi
  2388.     fi
  2389.     fi
  2390. else
  2391.     echo "Last time you said the hostname was $hostname"
  2392. fi
  2393. : you do not want to know about this
  2394. set $hostname
  2395. hostname=$1
  2396.  
  2397. : translate upper to lower if necessary
  2398. case "$hostname" in
  2399.     *[A-Z]*)
  2400.     hostname=`echo $hostname | tr '[A-Z]' '[a-z]'`
  2401.     echo "(Normalizing case in your host name)"
  2402.     ;;
  2403. esac
  2404.  
  2405. : verify guess
  2406. if $test "$hostname" ; then
  2407.     dflt=y
  2408.     echo 'Your host name appears to be "'$hostname'".'
  2409.     $echo $n "Is this correct? [$dflt] $c"
  2410.     rp="Sitename is $hostname? [$dflt]"
  2411.     . myread
  2412.     case "$ans" in
  2413.       y*)  ;;
  2414.       *)      hostname='' ;;
  2415.     esac
  2416. fi
  2417.  
  2418. : bad guess or no guess
  2419. while $test "X$hostname" = X ; do
  2420.     dflt=''
  2421.     rp="Please type the (one word) name of your host:"
  2422.     $echo $n "$rp $c"
  2423.     . myread
  2424.     hostname="$ans"
  2425.     autohostname="$undef"
  2426. done
  2427.  
  2428. echo " "
  2429. case "$hostname" in
  2430. *.*)
  2431.     dflt=`$expr "X$hostname" : "X[^.]*\(\..*\)"`
  2432.     hostname=`$expr "X$hostname" : "X\([^.]*\)\."`
  2433.     echo "(Trimming domain name from host name--host name is now $hostname)"
  2434.     ;;
  2435. *)  case "$mydomain" in
  2436.     '') dflt='.UUCP';;
  2437.     *) dflt="$mydomain";;
  2438.     esac
  2439.     ;;
  2440. esac
  2441. rp="What is your domain name? [$dflt]"
  2442. $echo $n "$rp $c"
  2443. . myread
  2444. case "$ans" in
  2445. '') ;;
  2446. .*) ;;
  2447. *) ans=".$ans";;
  2448. esac
  2449. mydomain="$ans"
  2450.  
  2451. : a little sanity check here
  2452. case "$phostname" in
  2453. '') ;;
  2454. *)  case `$phostname` in
  2455.     $hostname$mydomain|$hostname) ;;
  2456.     *)
  2457.     case "$phostname" in
  2458.     sed*)
  2459.         echo "(That doesn't agree with your whoami.h file, by the way.)"
  2460.         ;;
  2461.     *)
  2462.         echo "(That doesn't agree with your $phostname command, by the way.)"
  2463.         ;;
  2464.     esac
  2465.     phostname=''
  2466.     ;;
  2467.     esac
  2468.     ;;
  2469. esac
  2470.  
  2471. : see if there is a whoami file
  2472. echo " "
  2473. if $test -r /usr/include/whoami.h ; then
  2474.     d_whoami="$define"
  2475.     echo "whoami.h found."
  2476. else
  2477.     d_whoami="$undef"
  2478. fi
  2479.  
  2480. : see how we will look up host name
  2481. echo " "
  2482. d_douname="$undef"
  2483. d_gethname="$undef"
  2484.  
  2485. if $contains '^gethostname$' libc.list >/dev/null 2>&1 ; then
  2486.     echo "gethostname() found."
  2487.     d_gethname="$define"
  2488.     ans=gethostname
  2489. elif xenix; then
  2490.     if $test -n "$uname"; then
  2491.     u_name=`$uname -n`
  2492.     else
  2493.     u_name=
  2494.     fi
  2495.     if $test -n "$line"; then
  2496.     if $test -r /etc/systemid; then
  2497.         s_name=`$line < /etc/systemid`
  2498.     else
  2499.         s_name=
  2500.     fi
  2501.     else
  2502.     s_name=
  2503.     fi
  2504.     if $test -n "$u_name"; then
  2505.     if $test "$u_name" = "$s_name"; then
  2506.         cat <<EOM
  2507. On Xenix, UUCP uses the name found in /etc/systemid, while uname()
  2508. returns the name compiled into the operating system via configure.
  2509. Elm needs the UUCP name, and currently these two match.  However, they
  2510. need not match.  Be sure to always keep these two names in sync.
  2511. Since they match, Elm will not consider that the Xenix uname function
  2512. is broken.  However, if you are not always able to make them
  2513. match, answer the compile in hostname question Yes.
  2514. EOM
  2515.         if $contains '^uname$' libc.list >/dev/null 2>&1 ; then
  2516.         echo "uname() found."
  2517.         d_douname="$define"
  2518.         ans=uname
  2519.         fi
  2520.     else
  2521.         cat <<EOM
  2522. On Xenix, UUCP uses the name found in /etc/systemid, while uname()
  2523. returns the name compiled into the operating system via configure.
  2524. Your /etc/systemid file contains $s_name.
  2525. But uname returns $u_name.
  2526. Since Elm needs the UUCP name, and currently these two do not match,
  2527. Elm will assume Xenix uname() is broken.
  2528. EOM
  2529.     fi
  2530.     else
  2531.     cat <<EOM
  2532. On Xenix, UUCP uses the name found in /etc/systemid, while uname()
  2533. returns the name compiled into the operating system via configure.
  2534. Elm needs the UUCP name, and currently the compiled in name is undefined.
  2535. Since mail needs the UUCP name, and these two need not match, Elm will
  2536. assume Xenix uname() is broken.
  2537. EOM
  2538.     fi
  2539. elif $contains '^uname$' libc.list >/dev/null 2>&1 ; then
  2540.     echo "uname() found."
  2541.     d_douname="$define"
  2542.     ans=uname
  2543. fi
  2544.  
  2545. case "$d_douname$d_gethname" in
  2546. *define*)
  2547.     case "$ign_hname" in
  2548.     '')    case "$d_host_comp" in
  2549.     "$define") dflt=y;;
  2550.     *)  dflt=n;;
  2551.     esac;;
  2552.     y)  dflt=y;;
  2553.     *)  dflt=n;;
  2554.     esac
  2555.     cat <<EOM
  2556.  
  2557. Every now and then someone has a $ans() that lies about the hostname
  2558. but can't be fixed for political or economic reasons.  Would you like to
  2559. EOM
  2560.     rp="pretend $ans() isn't there and maybe compile in the hostname? [$dflt]"
  2561.     $echo $n "$rp $c"
  2562.     . myread
  2563.     case "$ans" in
  2564.     y*) ign_hname=y
  2565.     d_douname="$undef"
  2566.     d_gethname="$undef"
  2567.     d_host_comp="$define"
  2568.     $echo $n "Okay... $c"
  2569.     ;;
  2570.     *)    ign_hname=n
  2571.     d_host_comp="$undef"
  2572.     ;;
  2573.     esac
  2574.     ;;
  2575. *)
  2576.     $cat <<EOT
  2577.  
  2578. There is no gethostname() or uname() on this system.  The hostname will
  2579. have to be compiled in.  It can be overridden in the global elm.rc file
  2580. in the library directory to specify hostname, hostfullname and hostdomain.
  2581. EOT
  2582.     d_host_comp="$define"
  2583.     ;;
  2584. esac
  2585.  
  2586. : see if errlst.o is in the lib.
  2587. echo " "
  2588. case "$d_errlst" in
  2589. "$define") dflt=y;;
  2590. "$undef")  dflt=n;;
  2591. *)       if $contains '^errlst$' libc.list >/dev/null 2>&1 ; then
  2592.         echo "errlst object found, will attempt to use systems"
  2593.         echo "sys_nerr and sys_errlist"
  2594.         dflt=y
  2595.         elif $contains '^sys_errlist$' libc.list >/dev/null 2>&1 ; then
  2596.         echo "sys_errlist found, will attempt to use systems"
  2597.         echo "sys_nerr and sys_errlist"
  2598.         dflt=y
  2599.         else
  2600.         echo "neither errlst object nor sys_errlist found, $package will use its own"
  2601.         dflt=n
  2602.         fi;;
  2603. esac
  2604.  
  2605. cat <<EOM
  2606.  
  2607. Elm would like to use the systems definitions of the error messages for system
  2608. errors.  These are usually contained in the global variables sys_errlist[] and
  2609. sys_nerr.  If these do not exist, there is a standard list built into Elm.
  2610.  
  2611. EOM
  2612.  
  2613. rp="Does the system support the sys_errlist[] global variable? [$dflt]"
  2614. $echo $n "$rp $c"
  2615. . myread
  2616. case "$ans" in
  2617.     y*) d_errlst="$define";;
  2618.     *)  d_errlst="$undef" ;;
  2619. esac
  2620.  
  2621. : see if fstruncate exists
  2622. set ftruncate d_ftruncate
  2623. eval $inlibc
  2624. : see if getopt exists
  2625. set getopt d_getopt
  2626. eval $inlibc
  2627.  
  2628. : see if strings.h is in /usr/include or /usr/include/sys
  2629. echo " "
  2630. strings=`loc string.h "" /usr/include $includepath`
  2631. if $test -z "$strings"; then
  2632.     strings=`loc strings.h "" /usr/include $includepath`
  2633. fi
  2634. while $test -z "$strings"; do
  2635.     echo " "
  2636.     dflt=''
  2637.     rp="What is the full path name of the include file directory? []"
  2638.     $echo $n "$rp $c"
  2639.     . myread
  2640.     includepath=`filexp $ans`
  2641.     if $test -d "$includepath"; then
  2642.         strings=`loc string.h "" /usr/include $includepath`
  2643.         if $test -z "$strings"; then
  2644.             strings=`loc strings.h "" /usr/include $includepath`
  2645.         fi
  2646.         if $test -z "$strings"; then
  2647.             $cat <<EOM
  2648.  
  2649. Include file string.h or strings.h not found in $includepath.
  2650. Elm requires string.h on USG type systems or strings.h on BSD type
  2651. systems.  Please specify the directory where one of these files can
  2652. be found.
  2653. EOM
  2654.         fi
  2655.     else
  2656.         echo "Directory $includepath not found"
  2657.     fi
  2658. done
  2659.  
  2660. strings_f=`$expr "$strings" : ".*/\(.*\)"`
  2661. if $test "$strings_f" = "string.h"; then
  2662.     d_strings="$undef"
  2663.     echo "Using string.h instead of strings.h"
  2664. else
  2665.     d_strings="$define"
  2666.     echo "Using strings.h instead of string.h"
  2667. fi
  2668. pwdinsys=`loc pwd.h "" /usr/include $includepath`
  2669. if $test -z "$pwdinsys"; then
  2670.     d_pwdinsys="$define"
  2671. else
  2672.     d_pwdinsys="$undef"
  2673. fi
  2674.  
  2675. : index or strcpy
  2676. echo " "
  2677. case "$d_index" in
  2678. n) dflt=n;;
  2679. *) dflt=y;;
  2680. esac
  2681. if $contains '^index$' libc.list >/dev/null 2>&1 ; then
  2682.     if $contains '^strchr$' libc.list >/dev/null 2>&1 ; then
  2683.     if $contains strchr "$strings" >/dev/null 2>&1 ; then
  2684.         if $contains index "$strings" >/dev/null 2>&1 ; then
  2685. #            has index, strchr, and index and strchr in strings.h
  2686.         echo "Your system has both index() and strchr().  Shall I use"
  2687.         rp="index() rather than strchr()? [$dflt]"
  2688.         $echo $n "$rp $c"
  2689.         . myread
  2690.         case "$ans" in
  2691.             n*) d_index="$define" ;;
  2692.             *)  d_index="$undef" ;;
  2693.         esac
  2694.         else
  2695. #            has index, strchr, and strchr in strings.h
  2696.         d_index="$define"
  2697.             echo "strchr() found."
  2698.         fi
  2699.     else
  2700. #            has index, strchr, and no strchr in strings.h
  2701.         d_index="$undef"
  2702.         echo "index() found."
  2703.     fi
  2704.     else
  2705. #            has only index, no strchr, strings.h is a moot point
  2706.     d_index="$undef"
  2707.     echo "index() found."
  2708.     fi
  2709. else
  2710.     if $contains '^strchr$' libc.list >/dev/null 2>&1 ; then
  2711.     d_index="$define"
  2712.     echo "strchr() found."
  2713.     else
  2714.     echo "No index() or strchr() found!"
  2715.     d_index="$undef"
  2716.     fi
  2717. fi
  2718.  
  2719. case "$d_mmdf" in
  2720. "$define") dflt=y;;
  2721. "$undef")  dflt=n;;
  2722. *)    if $test -f "$submit"; then
  2723.         dflt=y
  2724.     else
  2725.         dflt=n
  2726.     fi
  2727.     ;;
  2728. esac
  2729. $cat <<EOM
  2730.  
  2731. Some systems run MMDF as their Mail Transport Agent.  MMDF uses a
  2732. different way of delimiting messages in the mailbox files.  Other
  2733. systems don't run MMDF but use the MMDF separator in their mailbox
  2734. files.  The MMDF separator is usually a series of four Control A's.
  2735. $package needs to know if this system uses the MMDF style message
  2736. separator in its mailbox files.
  2737.  
  2738. EOM
  2739. rp="Does this system use MMDF style message separator? [$dflt]"
  2740. $echo $n "$rp $c"
  2741. . myread
  2742. case "$ans" in
  2743. y*) d_mmdf="$define";;
  2744. *)  d_mmdf="$undef";;
  2745. esac
  2746.  
  2747. : determine mail delivery agent for Elm to use
  2748. case "$mailer" in
  2749. '')
  2750.     if $test "$d_mmdf" = "$define" -a -f "$execmail"; then
  2751.      dflt="$execmail"
  2752.     elif $test "$d_mmdf" = "$define" -a -f "$submit"; then
  2753.     dflt="$submit"
  2754.     elif $test -f "$sendmail"; then
  2755.     dflt="$sendmail"
  2756.     elif $test -f "$rmail"; then
  2757.     dflt="$rmail"
  2758.     elif $test -f /bin/mail; then
  2759.     dflt=/bin/mail
  2760.     else
  2761.     dflt=$mail
  2762.     fi
  2763.     ;;
  2764. *)  dflt="$mailer";;
  2765. esac
  2766. cont=true
  2767. while $test "$cont" ; do
  2768.     echo " "
  2769.     echo "Give the full path name of the program used to deliver mail on your"
  2770.     $echo $n "system: [$dflt] $c"
  2771.     rp="Preferred mail delivery agent: [$dflt]"
  2772.     . myread
  2773.     mailer="$ans"
  2774.     if $test -f "$ans"; then
  2775.     cont=''
  2776.     else
  2777.     if $test "$fastread" = yes; then
  2778.         dflt=y
  2779.     else
  2780.         dflt=n
  2781.     fi
  2782.     echo "Mail delivery agent $ans doesn't exist."
  2783.     rp="Use that name anyway? [$dflt]"
  2784.     $echo $n "$rp $c"
  2785.     . myread
  2786.     dflt=''
  2787.     case "$ans" in
  2788.     y*) cont='';;
  2789.     esac
  2790.     fi
  2791. done
  2792. if $test "$mailer" != "$sendmail"; then
  2793.     sendmail=''
  2794. fi
  2795. if $test "$mailer" != "$submit"; then
  2796.     submit=''
  2797. fi
  2798. if $test "$mailer" != "$execmail"; then
  2799.     execmail=''
  2800. fi
  2801.  
  2802. : check for internet mailer
  2803. case "$d_internet" in
  2804. "$define")    dflt=y;;
  2805. "$undef")    dflt=n;;
  2806. *)    if $test -f "$sendmail"; then
  2807.         dflt=y
  2808.     elif $test -f "$submit"; then
  2809.         dflt=y
  2810.     elif $test -f "$smail"; then
  2811.         dflt=y
  2812.     else
  2813.         dflt=n
  2814.     fi
  2815.     ;;
  2816. esac
  2817. $cat <<EOM
  2818.  
  2819. Some newer mailers can deliver mail to addresses of the INTERNET
  2820. persuasion, such as user@host.domain.  Other older mailers require the
  2821. complete uucp ! path to the destination to be specified in the address.
  2822. EOM
  2823. rp="Does your mailer understand INTERNET addresses? [$dflt]"
  2824. $echo $n "$rp $c"
  2825. . myread
  2826. case "$ans" in
  2827. y*) d_internet="$define";;
  2828. *)  d_internet="$undef";;
  2829. esac
  2830.  
  2831. : check for ispell spelling checker
  2832. case "$d_ispell" in
  2833. "$define")    dflt=y
  2834.         dflt_path=$ispell_path
  2835.         dflt_options=$ispell_options
  2836.         ;;
  2837. "$undef")    dflt=n
  2838.         dflt_path=
  2839.         dflt_options=
  2840.         ;;
  2841. *)    if $test -n "$ispell" -a "$ispell" != "ispell"; then
  2842.         dflt=y
  2843.         dflt_path=$ispell
  2844.         dflt_options='-x'
  2845.     else
  2846.         dflt=n
  2847.         dflt_path=
  2848.         dflt_options=
  2849.     fi
  2850.     ;;
  2851. esac
  2852. $cat <<EOM
  2853.  
  2854. Elm has the ability to place a call to the GNU ispell spelling checker
  2855. on its post-message-entry/pre-message-send menu.
  2856. EOM
  2857. if $test -n "$dflt_path"; then
  2858.     $echo "Configure has found ispell as $dflt_path"
  2859. else
  2860.     $echo "Configure was unable to find ispell"
  2861. fi
  2862.  
  2863. $echo $n "Should Elm add the ispell option to the pre-send menu? [$dflt] $c"
  2864. rp="Should Elm add the ispell option to the pre-send menu? [$dflt]"
  2865. . myread
  2866. case "$ans" in
  2867. y*) d_ispell="$define";;
  2868. *)  d_ispell="$undef";;
  2869. esac
  2870.  
  2871. case "$d_ispell" in
  2872. "$undef")    ispell_path=
  2873.         ;;
  2874. "$define")    cont=true
  2875.         dflt=$dflt_path
  2876.         while $test "$cont" ; do
  2877.             echo " "
  2878.             echo "Give the name of the ispell program on your"
  2879.             $echo $n "system: [$dflt] $c"
  2880.             rp="Ispell path name: [$dflt]"
  2881.             . myread
  2882.             ispell_path=$ans;
  2883.             if $test -f "$ans"; then
  2884.             cont=''
  2885.             else
  2886.             lookup=`loc "$ans" "" . $pth`
  2887.             if $test -f "$lookup"; then
  2888.                 cont=''
  2889.                 ispell_path=$lookup
  2890.             else
  2891.                 if $test "$fastread" = yes; then
  2892.                 dflt=y
  2893.                 else
  2894.                 dflt=n
  2895.                 fi
  2896.                 echo "spelling program $ans doesn't exist."
  2897.                 rp="Use that name anyway? [$dflt]"
  2898.                 $echo $n "$rp $c"
  2899.                 . myread
  2900.                 dflt=''
  2901.                 case "$ans" in
  2902.                 y*) cont='';;
  2903.                 esac
  2904.             fi
  2905.             fi
  2906.         done
  2907.  
  2908.         dflt=$dflt_options
  2909.         $echo $n "What options should Elm use with $ispell_path: [$dflt] $c"
  2910.         rp="$ispell_path options: [$dflt]"
  2911.         . myread
  2912.         ispell_options=$ans;
  2913.         ;;
  2914. esac
  2915. : see if locale.h is in /usr/include
  2916. echo " "
  2917. dflt=`loc locale.h "" /usr/include $includepath`
  2918. if $test -z "$dflt"; then
  2919.     echo "locale.h not found, $package will not call setlocale"
  2920.     d_locale=$undef
  2921. else
  2922.     echo "locale.h found, $package will call setlocale"
  2923.     d_locale=$define
  2924. fi
  2925.  
  2926. : see if nl_types.h is in /usr/include
  2927. echo " "
  2928. dflt=`loc nl_types.h "" /usr/include $includepath`
  2929. if $test -z "$dflt"; then
  2930.     echo "nl_types.h not found, $package will use its own"
  2931.     d_nl_types=$undef
  2932. else
  2933.     echo "nl_types.h found, $package will include the systems version"
  2934.     d_nl_types=$define
  2935. fi
  2936.  
  2937. : see if catgets is in the libraries
  2938. set catgets d_msgcat
  2939. eval $inlibc
  2940.  
  2941. if $test "$d_msgcat" = "$define"; then
  2942.     echo "Message catalog routines found"
  2943.     cat <<EOM
  2944.  
  2945. The system has the message catalog routines in its library.  These routines
  2946. are new, and on some systems do not function properly. Also, $package expects
  2947. that these routines are X/Open compliant.
  2948.  
  2949. EOM
  2950.  
  2951.     case "$d_usenls" in
  2952.     "$define") dflt=y;;
  2953.     "$undef")  dflt=n;;
  2954.     *)       dflt=n;;
  2955.     esac
  2956.  
  2957.     rp="Should $package use its own routines instead of the systems NLS routines? [$dflt]"
  2958.     $echo $n "$rp $c"
  2959.     . myread
  2960.     case "$ans" in
  2961.         y*) d_usenls="$define"
  2962.         d_nl_types=$undef;;
  2963.         *)  d_usenls="$undef";;
  2964.     esac
  2965. else
  2966.     echo "Message catalog routines not found, $package will use its own"
  2967.     if $test "$d_usenls" = ""; then
  2968.         d_usenls="$define"
  2969.     fi
  2970. fi
  2971.  
  2972. : see if stdlib.h is in includepath
  2973. echo " "
  2974. i_stdlib=`loc stdlib.h "" /usr/include $includepath`
  2975. if $test -n "$i_stdlib"; then
  2976.     echo "Found <stdlib.h>"
  2977.     i_stdlib="$define"
  2978. else
  2979.     echo "Did not find <stdlib.h>"
  2980.     i_stdlib="$undef"
  2981. fi
  2982.  
  2983. : see if malloc is void * or char *
  2984. echo " "
  2985. case "$d_mallocvoid" in
  2986. "$define") dflt=y;;
  2987. "$undef")  dflt=n;;
  2988. *)    if $test "$i_stdlib" = "$define" ; then
  2989.         cat >usemymalloc.c <<'END'
  2990. #include <stdlib.h>
  2991. void *malloc();
  2992. END
  2993.     else
  2994.         cat >usemymalloc.c <<'END'
  2995. #include <malloc.h>
  2996. void *malloc();
  2997. END
  2998.         fi
  2999.     if $cc $ccflags -c usemymalloc.c >/dev/null 2>&1; then
  3000.         d_mallocvoid=$define
  3001.         echo "Your system wants malloc to return void *, it would seem."
  3002.     else
  3003.         d_mallocvoid=$undef
  3004.         echo "Your system wants malloc to return char *, it would seem."
  3005.     fi
  3006.     ;;
  3007. esac
  3008. echo " "
  3009.  
  3010. case "$d_mboxedit" in
  3011. "$define") dflt=y;;
  3012. "$undef")  dflt=n;;
  3013. *)    dflt=n;;
  3014. esac
  3015. $cat <<EOM
  3016.  
  3017. A lot of sites that install the Elm Mail System find that the function
  3018. E)dit mailbox from within Elm is dangerous and confusing.  If you choose,
  3019. you can instead disable that function, with the program being slightly
  3020. smaller and presenting an appropriate error message to the user if they
  3021. try to E)dit their mailbox.
  3022.  
  3023. EOM
  3024. rp="Would you like to enable the E)dit Mailbox function? [$dflt]"
  3025. $echo $n "$rp $c"
  3026. . myread
  3027. case "$ans" in
  3028. y*) d_mboxedit="$define";;
  3029. *)  d_mboxedit="$undef";;
  3030. esac
  3031.  
  3032. : see if memcpy exists
  3033. set memcpy d_memcpy
  3034. eval $inlibc
  3035.  
  3036. : determine if MIME should be compiled in
  3037.  
  3038. case "$d_mime" in
  3039. "$define") dflt=y;;
  3040. "$undef")  dflt=n;;
  3041. *)       if $test -f "$metamail"; then
  3042.         $cat <<EOM
  3043.  
  3044. I've found the metamail program out there, I assume you want support for
  3045. MIME (Multipurpose Internet Mail Extension, RFC 1341).
  3046.  
  3047. EOM
  3048.         dflt=y
  3049.        else
  3050.         dflt=n
  3051.        fi;;
  3052.  
  3053. esac
  3054. $cat <<EOM
  3055.  
  3056. MIME allows for sending and receiving of Messages compliant to the
  3057. Multipurpose Internet Mail Extension (RFC 1341). MIME provides a way to
  3058. attach binary, graphic, audio, video, postscript and other files. MIME
  3059. doesn't necessarily need graphics capabilities on your display, but its
  3060. useful.
  3061.  
  3062. If you have installed Nathaniel Borenstein's metamail package for
  3063. displaying MIME messages, elm can make use of it.  If you didn't
  3064. have metamail installed you might want to obtain a copy of it.  The
  3065. most recent version is on thumper.bellcore.com [128.96.41.1], or ask
  3066. the archie servers for the nearest site.
  3067.  
  3068. Compiling elm even with MIME support enabled would not depend on the
  3069. metamail package, but you would not be able to use nearly all of the
  3070. MIME features as long as you don't have metamail installed.  Metamail
  3071. with its companion programs (mmencode) must be installed somewhere in
  3072. the search path, usually /usr/local/bin.
  3073.   
  3074.  
  3075.  
  3076. EOM
  3077.  
  3078. rp="Should support for MIME be compiled in? [$dflt]"
  3079. $echo $n "$rp $c"
  3080. . myread
  3081. case "$ans" in
  3082. y*) d_mime="$define";;
  3083. *)  d_mime="$undef";;
  3084. esac
  3085.  
  3086.  
  3087. case "$defcharset" in
  3088. '') defcharset="US-ASCII";;
  3089. *) defcharset="$defcharset";;
  3090. esac
  3091.  
  3092. case "$defdispcharset" in
  3093. '') defdispcharset="$defcharset";;
  3094. *) defdispcharset="$defdispcharset";;
  3095. esac
  3096.  
  3097. case "$defencoding" in
  3098. '') if $test "$defcharset" = "US-ASCII"; then
  3099.         defencoding="7bit"
  3100.     else
  3101.         defencoding="8bit"
  3102.     fi;;
  3103. *) defencoding="$defencoding";;
  3104. esac
  3105.  
  3106. if $test "$d_mime" = "$define"; then
  3107.     dflt="$defcharset"
  3108. cat <<EOM
  3109.  
  3110. The Default Character Set which should be used on outgoing messages.
  3111. Most sites would use US-ASCII.
  3112.  
  3113. EOM
  3114.     rp="Default Character Set for MIME Content-type text? [$dflt]"
  3115.     $echo $n "$rp $c"
  3116.     . myread
  3117.     defcharset="$ans"
  3118.  
  3119.     dflt="$defdispcharset"
  3120.     $cat <<EOM
  3121.  
  3122. The Character Set which your terminals support. You could set this
  3123. to one of the ISO-8859 charsets, even if you set the default for
  3124. the Text Messages to US-ASCII, as the ISO-8859 charsets could display
  3125. US-ASCII as well. For a X-Windows environment, ISO-8859-1 would be 
  3126. a convenient value.
  3127.  
  3128. EOM
  3129.     rp="Default Character Set which could be displayed [$dflt]"
  3130.     $echo $n "$rp $c"
  3131.     . myread
  3132.     defdispcharset="$ans"
  3133.  
  3134.     dflt="$defencoding"
  3135.     $cat <<EOM
  3136. Default Content-Transfer-Encoding for MIME Content-type text.
  3137. If you are using the default US-ASCII charset, you should use
  3138. 7bit encoding. But if you are using some other national character
  3139. set, 8bit is recommended, unless you are using a 7bit character set.
  3140. For 8bit encoding your transport paths should be 8bit clean, which
  3141. is not true all over the world. base64 or quoted-printable aren't
  3142. yet supported for the default Content-Transfer-Encoding.
  3143.  
  3144. EOM
  3145.     rp="Default Content-Transfer-Encoding for MIME Content-type text? [$dflt]"
  3146.     $echo $n "$rp $c"
  3147.     . myread
  3148.     defencoding="$ans"
  3149. fi
  3150.  
  3151. : see if mkdir exists
  3152. set mkdir d_mkdir
  3153. eval $inlibc
  3154.  
  3155. : ask about newmail running in the background automatically
  3156. case "$d_newauto" in
  3157. "$define")    dflt=y;;
  3158. "$undef")    dflt=n;;
  3159. *)        dflt=y;;
  3160. esac
  3161. $cat <<EOM
  3162.  
  3163. Newmail (Elm's utility to check for incoming mail) can be configured to
  3164. either run as a foreground process or as a process that automatically
  3165. forks and runs in the background.
  3166.  
  3167. EOM
  3168. rp="Should newmail automatically run in the background? [$dflt]"
  3169. $echo $n "$rp $c"
  3170. . myread
  3171. case "$ans" in
  3172. y*) d_newauto="$define";;
  3173. *)  d_newauto="$undef";;
  3174. esac
  3175.  
  3176.  
  3177. if $test -f "$sendmail"; then
  3178.     echo "You're running sendmail.  Setting noaddfrom, nocheckvalid, usedomain"
  3179.     d_noaddfrom="$define"
  3180.     d_nocheckvalid="$define"
  3181.     d_usedomain="$undef"
  3182. elif $test -f "$submit"; then
  3183.     echo "You're running submit with MMDF.  Setting noaddfrom, nocheckvalid, usedomain"
  3184.     d_noaddfrom="$undef"
  3185.     d_nocheckvalid="$define"
  3186.     d_usedomain="$define"
  3187. elif $test -f "$execmail" -a "$d_mmdf" = "$define"; then
  3188.     echo "You're running execmail with MMDF.  Setting noaddfrom, nocheckvalid, usedomain"
  3189.     d_noaddfrom="$undef"
  3190.     d_nocheckvalid="$define"
  3191.     d_usedomain="$undef"
  3192. else
  3193.     case "$d_nocheckvalid" in
  3194.     "$define") dflt=n;;
  3195.     "$undef")  dflt=y;;
  3196.     *)       dflt=y;;
  3197.     esac
  3198.  
  3199.     $cat << EOM
  3200.  
  3201. Since you're not running sendmail or submit, should I check local user entered
  3202. addresses against the valid mailboxes on this system?
  3203. EOM
  3204.  
  3205.     echo " "
  3206.     rp="Would you like to check local addresses? [$dflt]"
  3207.     $echo $n "$rp $c"
  3208.     . myread
  3209.     case "$ans" in
  3210.     y*) d_nocheckvalid="$undef";;
  3211.     *)  d_nocheckvalid="$define";;
  3212.     esac
  3213.  
  3214.     if $test "$d_internet" = "$define"; then
  3215.         case "$d_usedomain" in
  3216.         "$define") dflt=y;;
  3217.         "$undef")  dflt=n;;
  3218.         *)       dflt=y;;
  3219.         esac
  3220.  
  3221.         $cat <<EOM
  3222.  
  3223. Are you running a machine where you want to have a domain name appended
  3224. to the hostname on outbound mail?
  3225. EOM
  3226.         echo " "
  3227.         rp="Would you like the domain name appended? [$dflt]"
  3228.         $echo $n "$rp $c"
  3229.         . myread
  3230.         case "$ans" in
  3231.         y*) d_usedomain="$define";;
  3232.         *)  d_usedomain="$undef";;
  3233.         esac
  3234.     else
  3235.         d_usedomain="$undef"
  3236.         $cat <<EOM
  3237.  
  3238. Since your mailer does not understand internet addresses, I'm undefining
  3239. usedomain so your domain name will not be appended to the hostname on
  3240. outbound mail.
  3241.  
  3242. EOM
  3243.     fi
  3244.  
  3245.     case "$d_noaddfrom" in
  3246.     "$define") dflt=y;;
  3247.     "$undef")  dflt=n;;
  3248.     *)       dflt=n;;
  3249.     esac
  3250.     echo " "
  3251.     rp="Does your mailer add the From: header for you? [$dflt]"
  3252.     $echo $n "$rp $c"
  3253.     . myread
  3254.     case "$ans" in
  3255.     y*) d_noaddfrom="$define";;
  3256.     *)  d_noaddfrom="$undef";;
  3257.     esac
  3258. fi
  3259.  
  3260. case "$d_noxheader" in
  3261. "$define") dflt=y;;
  3262. "$undef")  dflt=n;;
  3263. *)    dflt=n;;
  3264. esac
  3265. $cat <<EOM
  3266.  
  3267. Some sites do not like to see the mail header "X-mailer:" in outgoing
  3268. messages.  If you choose, you may disable these headers.  However, it
  3269. is strongly urged to leave these headers in the mail to assist in
  3270. tracking down problems.
  3271.  
  3272. EOM
  3273. rp="Would you like to disable the X-mailer: headers? [$dflt]"
  3274. $echo $n "$rp $c"
  3275. . myread
  3276. case "$ans" in
  3277. y*) d_noxheader="$define";;
  3278. *)  d_noxheader="$undef";;
  3279. esac
  3280.  
  3281. : check for "kill(pid, 0)"
  3282. echo " "
  3283. case "$d_pidcheck" in
  3284. "$define")    ;;
  3285. "$undef")    ;;
  3286. *)
  3287.         echo "Checking to see if kill(pid, 0) works..."
  3288.         $cat >try.c <<'EOCP'
  3289. main()
  3290.     {
  3291.     int    pid, status0, status9;
  3292.  
  3293.     if ((pid = fork()) == 0)
  3294.         {
  3295.         sleep(30);
  3296.         exit(1);
  3297.         }
  3298.     status0 = kill(pid, 0);
  3299.     status9 = kill(pid, 9);
  3300.     exit(status0 == status9);
  3301.     }
  3302. EOCP
  3303.         if $cc try.c -o try >/dev/null 2>&1 ; then
  3304.         if try >/dev/null 2>&1 ; then
  3305.             echo "Your system does not support kill(pid, 0)..."
  3306.             d_pidcheck="$undef"
  3307.         else
  3308.             d_pidcheck="$define"
  3309.             echo "Your system supports kill(pid, 0)..."
  3310.         fi
  3311.         else
  3312.         echo "Your system does not support kill(pid, 0)..."
  3313.         d_pidcheck="$undef"
  3314.         fi
  3315.         $rm -f try.c try.o try
  3316.     ;;
  3317. esac
  3318.  
  3319. : see if /usr/include/sys/ptem.h exists, making it a possible System V/386
  3320. d_ptem="$undef"
  3321. if usg ; then
  3322.     echo " "
  3323.     echo "Checking to see if your system has sys/ptem.h..."
  3324.     if $test -f /usr/include/sys/ptem.h ; then
  3325.         echo "Yep, it does..."
  3326.         if "$contains" "struct winsize" /usr/include/sys/ptem.h >/dev/null 2>&1 ; then
  3327.         d_ptem="$define"
  3328.         echo "  and it has the needed structure."
  3329.     fi
  3330.     fi
  3331. fi
  3332.  
  3333. : see how we invoke the C preprocessor
  3334. echo " "
  3335. echo "Now, how can we feed standard input to your C preprocessor..."
  3336. cat <<'EOT' >testcpp.c
  3337. #define ABC abc
  3338. #define XYZ xyz
  3339. ABC.XYZ
  3340. EOT
  3341. echo 'Maybe "'"$cc"' -E" will work...'
  3342. $cc -E <testcpp.c >testcpp.out 2>&1
  3343. : try to force gcc preprocessor if that is the compiler they are using
  3344. case $? in
  3345. 0) cppstdin="$cc -E";;
  3346. *) case "$cc" in
  3347.     *gcc*)
  3348.     cd ..
  3349.     echo 'Trying (cat >/tmp/$$.c; '"$cc"' -E /tmp/$$.c; rm /tmp/$$.c)'
  3350.     echo 'cat >/tmp/$$.c; '"$cc"' -E /tmp/$$.c; rm /tmp/$$.c' >cppstdin
  3351.     chmod 755 cppstdin
  3352.     cppstdin=`pwd`/cppstdin
  3353.     cppminus='';
  3354.     cd UU
  3355.     $cppstdin <testcpp.c >testcpp.out 2>&1
  3356.     ;;
  3357.     esac
  3358.     ;;
  3359. esac
  3360. if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
  3361.     echo "Yup, it does."
  3362.     cppstdin="$cc -E"
  3363.     cppminus='';
  3364. else
  3365.     echo 'Nope, maybe "'$cpp'" will work...'
  3366.     $cpp <testcpp.c >testcpp.out 2>&1
  3367.     if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
  3368.     echo "Yup, it does."
  3369.     cppstdin="$cpp"
  3370.     cppminus='';
  3371.     else
  3372.     echo 'No such luck...maybe "'$cpp' -" will work...'
  3373.     $cpp - <testcpp.c >testcpp.out 2>&1
  3374.     if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
  3375.         echo "It works!"
  3376.         cppstdin="$cpp"
  3377.         cppminus='-';
  3378.     else
  3379.         echo 'Nixed again...maybe "'"$cc"' -E -" will work...'
  3380.         $cc -E - <testcpp.c >testcpp.out 2>&1
  3381.         if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
  3382.         echo "Hooray, it works!  I was beginning to wonder."
  3383.         cppstdin="$cc -E"
  3384.         cppminus='-';
  3385.         else
  3386.         echo 'Nope...maybe "'"$cc"' -P" will work...'
  3387.         $cc -P <testcpp.c >testcpp.out 2>&1
  3388.         if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
  3389.             echo "Yup, that does."
  3390.             cppstdin="$cc -P"
  3391.             cppminus='';
  3392.         else
  3393.             echo 'Nope...maybe "'"$cc"' -P -" will work...'
  3394.             $cc -P - <testcpp.c >testcpp.out 2>&1
  3395.             if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
  3396.             echo "Yup, that does."
  3397.             cppstdin="$cc -P"
  3398.             cppminus='-';
  3399.             else
  3400.             echo 'Hmm...perhaps you already told me...'
  3401.             case "$cppstdin" in
  3402.             '') ;;
  3403.             *) $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1;;
  3404.             esac
  3405.             if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
  3406.                 echo "Hooray, you did!  I was beginning to wonder."
  3407.             else
  3408.                 echo 'Uh-uh.  Time to get fancy...'
  3409.                 cd ..
  3410.                 echo 'Trying (cat >/tmp/$$.c; '"$cc"' -E /tmp/$$.c; rm /tmp/$$.c)'
  3411.                 echo 'cat >/tmp/$$.c; '"$cc"' -E /tmp/$$.c; rm /tmp/$$.c' >cppstdin
  3412.                 chmod 755 cppstdin
  3413.                 cppstdin=`pwd`/cppstdin
  3414.                 cppminus='';
  3415.                 cd UU
  3416.                 $cppstdin <testcpp.c >testcpp.out 2>&1
  3417.                 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
  3418.                 echo "Eureka!."
  3419.                 else
  3420.                 dflt=blurfl
  3421.                 $echo $n "No dice.  I can't find a C preprocessor.  Name one: $c"
  3422.                 rp='Name a C preprocessor:'
  3423.                 . myread
  3424.                 cppstdin="$ans"
  3425.                 $cppstdin <testcpp.c >testcpp.out 2>&1
  3426.                 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
  3427.                     echo "OK, that will do."
  3428.                 else
  3429.                     echo "Sorry, I can't get that to work.  Go find one."
  3430.                     exit 1
  3431.                 fi
  3432.                 fi
  3433.             fi
  3434.             fi
  3435.         fi
  3436.         fi
  3437.     fi
  3438.     fi
  3439. fi
  3440. rm -f testcpp.c testcpp.out
  3441.  
  3442. : get C preprocessor symbols handy
  3443. echo " "
  3444. echo $attrlist | $tr ' ' '\012' >Cppsym.know
  3445. $cat <<EOSS >Cppsym
  3446. $startsh
  3447. case "\$1" in
  3448. -l) list=true
  3449.     shift
  3450.     ;;
  3451. esac
  3452. unknown=''
  3453. case "\$list\$#" in
  3454. 1|2)
  3455.     for sym do
  3456.     if $contains "^\$1$" Cppsym.true >/dev/null 2>&1; then
  3457.         exit 0
  3458.     elif $contains "^\$1$" Cppsym.know >/dev/null 2>&1; then
  3459.         :
  3460.     else
  3461.         unknown="\$unknown \$sym"
  3462.     fi
  3463.     done
  3464.     set X \$unknown
  3465.     shift
  3466.     ;;
  3467. esac
  3468. case \$# in
  3469. 0) exit 1;;
  3470. esac
  3471. echo \$* | $tr ' ' '\012' | $sed -e 's/\(.*\)/\\
  3472. #ifdef \1\\
  3473. exit 0; _ _ _ _\1\\     \1\\
  3474. #endif\\
  3475. /' >/tmp/Cppsym\$\$
  3476. echo exit 1 >>/tmp/Cppsym\$\$
  3477. $cppstdin $cppminus </tmp/Cppsym\$\$ >/tmp/Cppsym2\$\$
  3478. case "\$list" in
  3479. true) awk 'NF > 5 {print substr(\$6,2,100)}' </tmp/Cppsym2\$\$ ;;
  3480. *)
  3481.     sh /tmp/Cppsym2\$\$
  3482.     status=\$?
  3483.     ;;
  3484. esac
  3485. $rm -f /tmp/Cppsym\$\$ /tmp/Cppsym2\$\$
  3486. exit \$status
  3487. EOSS
  3488. chmod +x Cppsym
  3489. $eunicefix Cppsym
  3490. echo "Your C preprocessor defines the following symbols:"
  3491. Cppsym -l $attrlist >Cppsym.true
  3492. cat Cppsym.true
  3493. rmlist="$rmlist Cppsym Cppsym.know Cppsym.true"
  3494.  
  3495. : see if there is a putenv
  3496. set putenv d_putenv
  3497. eval $inlibc
  3498.  
  3499. : get remove at last flag and number of lock attempts
  3500. $cat <<EOM
  3501.  
  3502. The next pair of questions have to do with what to do when another
  3503. program has locked a mailbox...
  3504.  
  3505. First, how many times should the Elm check for the removal of the lock
  3506. file before giving up?
  3507. EOM
  3508.  
  3509. case "$maxattempts" in
  3510.     '') dflt=6;;
  3511.     *)  dflt=$maxattempts;;
  3512. esac
  3513. cont=true
  3514. while $test "$cont" ; do
  3515.     echo " "
  3516.     rp="Number of lock attempts: [$dflt]"
  3517.     $echo $n "$rp $c"
  3518.     . myread
  3519.     maxattempts="$ans"
  3520.     if $test "$maxattempts" -lt 3 -o "$maxattempts" -gt 10 ; then
  3521.     echo "The recommended range is 3-10"
  3522.     odflt=$dflt
  3523.     dflt=n
  3524.     rp="Should I use your answer of $maxattempts lock attempts anyway? [$dflt]"
  3525.     $echo $n "$rp $c"
  3526.     . myread
  3527.     dflt=$odflt
  3528.     case "$ans" in
  3529.     y*) cont='';;
  3530.     esac
  3531.     else
  3532.     cont=''
  3533.     fi
  3534. done
  3535.  
  3536. case "$d_remlock" in
  3537. "$define") dflt=y;;
  3538. "$undef")  dflt=n;;
  3539. *)       dflt=n;;
  3540. esac
  3541. echo " "
  3542. rp="Should it REMOVE the lock file after $maxattempts checks? [$dflt]"
  3543. $echo $n "$rp $c"
  3544. . myread
  3545. case "$ans" in
  3546. y*) d_remlock="$define";;
  3547. *)  d_remlock="$undef";;
  3548. esac
  3549.  
  3550. : see if rename exists
  3551. set rename d_rename
  3552. eval $inlibc
  3553.  
  3554. : determine where mail is spooled
  3555. case "$maildir" in
  3556. '')
  3557.     dflt=`loc . /usr/spool/mail /usr/spool/mail /var/mail /usr/mail`
  3558.     ;;
  3559. *)  dflt="$maildir"
  3560.     ;;
  3561. esac
  3562. cont=true
  3563. while $test "$cont" ; do
  3564.     echo " "
  3565.     rp="Where is yet-to-be-read mail spooled? [$dflt]"
  3566.     $echo $n "$rp $c"
  3567.     . myread
  3568.     maildir=`filexp "$ans"`
  3569.     if test -d $maildir; then
  3570.     cont=''
  3571.     else
  3572.     if $test "$fastread" = yes; then
  3573.         dflt=y
  3574.     else
  3575.         dflt=n
  3576.     fi
  3577.     rp="Directory $maildir doesn't exist.  Use that name anyway? [$dflt]"
  3578.     $echo $n "$rp $c"
  3579.     . myread
  3580.     dflt=''
  3581.     case "$ans" in
  3582.     y*) cont='';;
  3583.     esac
  3584.     fi
  3585. done
  3586.  
  3587. : determine the group of the mail directory and what group elm should use
  3588. mailgrp=`$ls -lgd $maildir/.`
  3589. mailgrp=`$expr "$mailgrp" : "[ld][rwxstS-]*[ 0123456789]*\(.*\)"`
  3590. : now mailgrp is either    user group size mon day time/year name
  3591. : or                       group size mon day time/year name
  3592. try1=`$expr "$mailgrp" : "[A-Za-z_0-9]* *\([A-Za-z_0-9]*\).*"`
  3593. try1a=`$expr "$try1" : "\([0-9]*\).*"`
  3594. if $test "$try1" = "$try1a"; then
  3595.     mailgrp=`$expr "$mailgrp" : "\([A-Za-z_0-9]*\).*"`
  3596. else
  3597.     mailgrp="$try1"
  3598. fi
  3599. case "$mailgrp" in
  3600. '')
  3601.     mailgrp=mail
  3602.     ;;
  3603. esac
  3604. echo " "
  3605. echo "Mail group is $mailgrp"
  3606.  
  3607. : ask about setgid running of Elm
  3608. case "$d_setgid" in
  3609. "$define")    dflt=y;;
  3610. "$undef")    dflt=n;;
  3611. *)        dflt=y;;
  3612. esac
  3613. cat <<EOM
  3614.  
  3615. Elm needs to be installed and run as a setgid program only if the mail
  3616. spool directory permissions do not allow world write access.  If your
  3617. mail spool directory has the permissions:
  3618.  
  3619. drwxrwxr-x  3 root     mail          512 Dec 24 17:20 /usr/mail
  3620.  
  3621. then Elm must be setgid to the same group as the mail spool directory
  3622. (in this case group mail).  However, if the spool permissions look
  3623. like:
  3624.  
  3625. drwxrwsrwt  2 root     staff         512 Dec 21 20:14 /usr/spool/mail
  3626.  
  3627. then Elm should not be installed or run as a setgid program.
  3628.  
  3629. EOM
  3630. rp="Am I going to be running as a setgid program? [$dflt]"
  3631. $echo $n "$rp $c"
  3632. . myread
  3633. case "$ans" in
  3634. y*) d_setgid="$define";;
  3635. *)  d_setgid="$undef";;
  3636. esac
  3637. case "$d_setgid" in
  3638. "$define")
  3639.     mailermode=2755
  3640.     cat <<EOM
  3641.  
  3642. Since Elm is being installed as a setgid program, it must be installed
  3643. by root, or a user able to set the setgid bit.
  3644.  
  3645. To provide better security, Elm can be configured to switch to the
  3646. privileged group of $mailgrp only when necessary to access mail folders.
  3647.  
  3648. Unfortunately, not all machines can switch between the real and effective 
  3649. gid values.  If you are not sure of the capability of your machine, it
  3650. is suggested that you start with Elm configured to switch gid values and
  3651. if, when you run Elm it cannot set the lock for the mailbox, reconfigure
  3652. Elm to not use this feature.
  3653. EOM
  3654.     case "$d_savegrpmboxid" in
  3655.     "$define")    dflt=y;;
  3656.     "$undef")    dflt=n;;
  3657.     *)        dflt=y;;
  3658.     esac
  3659.     echo " "
  3660.     rp="Can your system use setgid() to switch between the real and
  3661. effective gid values? [$dflt]"
  3662.     $echo $n "$rp $c"
  3663.     . myread
  3664.     case "$ans" in
  3665.     y*) d_savegrpmboxid="$define";;
  3666.     *)  d_savegrpmboxid="$undef";;
  3667.     esac
  3668.     ;;
  3669. *)  mailermode=755
  3670.     d_savegrpmboxid="$undef"
  3671.     ;;
  3672. esac
  3673.  
  3674. : see if BSD sigset exists
  3675. echo " "
  3676. set sigset d_sigset
  3677. eval $inlibc
  3678. : See if sigaction exists -- POSIX has highest priority in match
  3679. if $contains sigaction libc.list >/dev/null 2>&1; then
  3680.     echo "sigaction() found."
  3681.     d_sigaction="$define"
  3682.     d_sigset="$undef"
  3683.     d_sigvec="$undef"
  3684.     d_sigvectr="$undef"
  3685. else
  3686.     d_sigaction="$undef"
  3687. : see if sigvector exists -- since sigvec will match the substring
  3688.     if $contains sigvector libc.list >/dev/null 2>&1; then
  3689.         echo 'sigvector() found--you must be running HP-UX.'
  3690.         d_sigvectr="$define"
  3691.         d_sigvec="$define"
  3692.     else
  3693. : try the original name
  3694.         d_sigvectr="$undef"
  3695.         if $contains sigvec libc.list >/dev/null 2>&1; then
  3696.         echo 'sigvec() found.'
  3697.         d_sigvec="$define"
  3698.         else
  3699.         case "$d_sigset" in
  3700.         "$define")
  3701.                echo 'sigvec() not found';;
  3702.         *)
  3703.                echo 'sigvec() not found--race conditions with signals may occur.';;
  3704.         esac
  3705.             d_sigvec="$undef"
  3706.         fi
  3707.     fi
  3708. fi
  3709.  
  3710. : see if sigprocmask exists -- POSIX has highest priority in match
  3711. echo " "
  3712. if $contains sigprocmask libc.list >/dev/null 2>&1; then
  3713.     echo 'sigprocmask() found.'
  3714.     d_sigprocmask="$define"
  3715.     d_sigblock="$undef"
  3716.     d_sighold="$undef"
  3717. else
  3718.     d_sigprocmask="$undef"
  3719. : see if sigblock exists
  3720.     if $contains sigblock libc.list >/dev/null 2>&1; then
  3721.     echo 'sigblock() found.'
  3722.     d_sigblock="$define"
  3723.     d_sighold="$undef"
  3724.     else
  3725. : see if sighold exists
  3726.     d_sigblock="$undef"
  3727.     if $contains sighold libc.list >/dev/null 2>&1; then
  3728.         echo 'sighold() found.'
  3729.         d_sighold="$define"
  3730.     else
  3731.         echo 'No signal masking functions found.'
  3732.         d_sighold="$undef"
  3733.     fi
  3734.     fi
  3735. fi
  3736.  
  3737. : see if strspn exists
  3738. set strspn d_strspn
  3739. eval $inlibc
  3740.  
  3741. : see if strcspn exists
  3742. set strcspn d_strcspn
  3743. eval $inlibc
  3744.  
  3745. : see if strpbrk exists
  3746. set strpbrk d_strpbrk
  3747. eval $inlibc
  3748.  
  3749. : see if there is a strerror
  3750. set strerror d_strerror
  3751. eval $inlibc
  3752.  
  3753. : see if there is a strstr
  3754. set strstr d_strstr
  3755. eval $inlibc
  3756.  
  3757. : see if there is a strtok
  3758. set strtok d_strtok
  3759. eval $inlibc
  3760.  
  3761. case "$d_subshell" in
  3762. "$define") dflt=y;;
  3763. "$undef")  dflt=n;;
  3764. *)    dflt=y;;
  3765. esac
  3766. $cat <<EOM
  3767.  
  3768. Some sites wish to disable the usage of the shell escape from Elm.
  3769. If you choose, you can disallow subshells from within Elm.
  3770.  
  3771. Note: This only controls Elm's usage of the ! command.  Any pager or
  3772. editor could still allow subshells.
  3773.  
  3774. EOM
  3775. rp="Would you like to allow the ! command (subshells)? [$dflt]"
  3776. $echo $n "$rp $c"
  3777. . myread
  3778. case "$ans" in
  3779. y*) d_subshell="$define";;
  3780. *)  d_subshell="$undef";;
  3781. esac
  3782.  
  3783. : see if symlink exists
  3784. set symlink d_symlink
  3785. eval $inlibc
  3786.  
  3787. : see if tempnam exists
  3788. set tempnam d_tempnam
  3789. eval $inlibc
  3790.  
  3791. : see if this is a termio system
  3792. : Prefer POSIX-approved termios.h over all else.
  3793. :
  3794. echo " "
  3795. d_termios="$undef"
  3796. d_termio="$undef"
  3797. if $test -r /usr/include/termios.h ; then
  3798.     set tcsetattr d_termios
  3799.     eval $inlibc
  3800. fi
  3801. if $test "$d_termios" = "$define" ; then
  3802.     echo "You have POSIX termios.h... good!"
  3803. elif Cppsym pyr ; then
  3804.     if $test "`/bin/universe`" = "ucb" ; then
  3805.     if $test -r /usr/include/sgtty.h ; then
  3806.         echo "sgtty.h found."
  3807.     else
  3808.         echo "System is a pyramid, and universe is bsd,"
  3809.         echo "sgtty.h not found--you could have problems."
  3810.     fi
  3811.     else
  3812.     if $test -r /usr/include/termio.h ; then
  3813.         d_termio="$define"
  3814.         echo "termio.h found."
  3815.     else
  3816.         echo "System is a pyramid, and universe is att,"
  3817.         echo "termio.h not found--you could have problems."
  3818.     fi
  3819.     fi
  3820. elif bsd ; then
  3821.     if $test -r /usr/include/sgtty.h ; then
  3822.     echo "sgtty.h found."
  3823.     elif $test -r /usr/include/termio.h ; then
  3824.     d_termio="$define"
  3825.     echo "termio.h found."
  3826.     else
  3827.     echo "Neither termio.h nor sgtty.h found--you could have problems."
  3828.     fi
  3829. else
  3830.     if $test -r /usr/include/termio.h ; then
  3831.     d_termio="$define"
  3832.     echo "termio.h found."
  3833.     elif $test -r /usr/include/sgtty.h ; then
  3834.     echo "sgtty.h found."
  3835.     else
  3836.     echo "Neither termio.h nor sgtty.h found--you could have problems."
  3837.     fi
  3838. fi
  3839.  
  3840. : see if we should include time.h, sys/time.h, or both
  3841. cat <<'EOM'
  3842.   
  3843. Testing to see if we should include <time.h>, <sys/time.h> or both.
  3844. I'm now running the test program...
  3845. EOM
  3846. $cat >try.c <<'EOCP'
  3847. #ifdef I_TIME
  3848. #include <time.h>
  3849. #endif
  3850. #ifdef I_SYSTIME
  3851. #ifdef SYSTIMEKERNEL
  3852. #define KERNEL
  3853. #endif
  3854. #include <sys/time.h>
  3855. #endif
  3856. main()
  3857. {
  3858.     struct tm foo;
  3859. #ifdef S_TIMEVAL
  3860.     struct timeval bar;
  3861. #endif
  3862.     if (foo.tm_sec == foo.tm_sec)
  3863.     exit(0);
  3864. #ifdef S_TIMEVAL
  3865.     if (bar.tv_sec == bar.tv_sec)
  3866.     exit(0);
  3867. #endif
  3868.     exit(1);
  3869. }
  3870. EOCP
  3871. flags=''
  3872. for s_timeval in '-DS_TIMEVAL' ''; do
  3873.     for d_systimekernel in '' '-DSYSTIMEKERNEL'; do
  3874.     for i_time in '-DI_TIME' ''; do
  3875.         for i_systime in '-DI_SYSTIME' ''; do
  3876.         case "$flags" in
  3877.         '') echo "Trying $i_time $i_systime $d_systimekernel $s_timeval"
  3878.             if $cc $ccflags $i_time $i_systime $d_systimekernel $s_timeval \
  3879.                 try.c -o try >/dev/null 2>&1 ; then
  3880.             set X $i_time $i_systime $d_systimekernel $s_timeval
  3881.             shift
  3882.             flags="$*"
  3883.             echo "Succeeded with $flags"
  3884.             fi
  3885.             ;;
  3886.         esac
  3887.         done
  3888.     done
  3889.     done
  3890. done
  3891. case "$flags" in
  3892. *SYSTIMEKERNEL*) d_systimekernel="$define";;
  3893. *) d_systimekernel="$undef";;
  3894. esac
  3895. case "$flags" in
  3896. *I_TIME*) i_time="$define";;
  3897. *) i_time="$undef";;
  3898. esac
  3899. case "$flags" in
  3900. *I_SYSTIME*) i_systime="$define";;
  3901. *) i_systime="$undef";;
  3902. esac
  3903. $rm -f try.c try
  3904.  
  3905. : see if there is a tzname
  3906. set tzname d_tzname
  3907. eval $inlibc
  3908.  
  3909. if $test "$d_tzname" = "$undef"; then
  3910.     set _tzname d_tzname
  3911.     eval $inlibc
  3912. fi
  3913.  
  3914. timeincl=""
  3915. if $test "$i_time" = define ; then
  3916.     timeincl="/usr/include/time.h"
  3917. fi
  3918. if $test "$i_systime" = define ; then
  3919.     timeincl="$timeincl /usr/include/sys/time.h"
  3920. fi
  3921. $cat $timeincl /dev/null | $cppstdin $cppminus > try.c 2>&1
  3922. if $contains 'tz_minuteswest' try.c > /dev/null 2>&1 ; then
  3923.     echo "You have tz_minuteswest defined in $timeincl rather than timezone."
  3924.     d_tz_min="$define"
  3925. else
  3926.     echo "You have timezone defined in $timeincl rather than tz_minuteswest."
  3927.     d_tz_min="$undef"
  3928. fi
  3929.  
  3930. #    try alternate test for nm commands that have problems
  3931. #    with data items being parsed
  3932.  
  3933.  
  3934. if Cppsym ultrix ; then
  3935.     echo "running Ultrix, will not test for tzname in $timeincl"
  3936. else
  3937.     if $test "$d_tzname" = "$undef"; then
  3938.     if $contains tzname try.c >/dev/null 2>&1 ; then
  3939.         echo "tzname found in $timeincl"
  3940.         d_tzname="$define"
  3941.     fi
  3942.     fi
  3943. fi
  3944.  
  3945. $rm -f try.c
  3946. : check for valid reply/to fields
  3947. case "$d_useembed" in
  3948. "$define")    dflt=y;;
  3949. "$undef")    dflt=n;;
  3950. *)            if $test "$d_internet" = "$define" ; then
  3951.                 dflt=y
  3952.             else
  3953.                 dflt=n
  3954.             fi
  3955.             ;;
  3956. esac
  3957. $cat <<EOM
  3958.  
  3959. One of the more annoying quirks of the UUCP network and various other
  3960. systems that interact with it are that everyone seems to have different
  3961. ideas about how to do routing, etc.  Therefore, a lot of times e-mail
  3962. will arrive from off site with corrupt, unusable "Reply-To:" and "From:"
  3963. fields.  This next question relates to whether your site is liable to
  3964. get mangled fields or not...
  3965.  
  3966. Does your site receive e-mail with valid "Reply-To:" and "From:" fields?
  3967.  
  3968. EOM
  3969. $echo $n "Use Reply-To: and From: addresses? [$dflt] $c"
  3970. rp="Are Reply-to: and From: addresses reliable? [$dflt]"
  3971. . myread
  3972. case "$ans" in
  3973. y*) d_useembed="$define";;
  3974. *)  d_useembed="$undef";;
  3975. esac
  3976.  
  3977. : see if getdomainname exists
  3978. if $contains "^getdomainname\$" libc.list > /dev/null 2>&1; then
  3979.     echo "getdomainname() found"
  3980.     d_domname=$define;
  3981. elif $contains "^getdomnm\$" libc.list > /dev/null 2>&1; then
  3982.     echo "getdomainname() found"
  3983.     d_domname=$define;
  3984. else
  3985.     echo "getdomainname() not found"
  3986.     d_domname=$undef
  3987. fi
  3988.  
  3989. case "$d_domname" in
  3990. "$define")    cat <<EOM
  3991.  
  3992. The getdomainname system call was found.  When running NIS, this usually
  3993. returns the NIS domain and not the mail domain.  If this is the case,
  3994. it should not be used to obtain the domain name, and the domain name
  3995. should be compiled into the code, and the global elm.rc file should
  3996. be used to override the compiled in value.
  3997.  
  3998. If the getdomainname call does return the correct mail domain, it can
  3999. be used.
  4000.  
  4001. EOM
  4002.         case "$d_usegetdom" in
  4003.         "$define")    dflt=y;;
  4004.         "$undef")    dflt=n;;
  4005.         *)        dflt=y;;
  4006.         esac
  4007.         echo " "
  4008.         rp="Should getdomainname() be used to obtain the mail domain? [$dflt]"
  4009.         $echo $n "$rp $c"
  4010.         . myread
  4011.         case "$ans" in
  4012.         y*) d_usegetdom="$define";;
  4013.         *)  d_usegetdom="$undef";;
  4014.         esac
  4015.         ;;
  4016. *)        d_usegetdom="$undef";;
  4017. esac;
  4018. : see if utime.h is in includepath
  4019. echo " "
  4020. i_utime=`loc utime.h "" /usr/include $includepath`
  4021. if $test -n "$i_utime"; then
  4022.     echo "Found <utime.h>"
  4023.     i_utime="$define"
  4024.     i_sysutime="$undef"
  4025. else
  4026.     i_sysutime=`loc sys/utime.h "" /usr/include $includepath`
  4027.     if $test -n "$i_sysutime"; then
  4028.         echo "Found <sys/utime.h>"
  4029.         i_utime="$undef"
  4030.         i_sys/utime="$define"
  4031.     else
  4032.         echo "Did not find <utime.h> or <sys/utime.h>"
  4033.         i_utime="$undef"
  4034.         i_sysutime="$undef"
  4035.     fi
  4036. fi
  4037.  
  4038. : check for utimbuf structure
  4039. echo " "
  4040. case "$d_utimbuf" in
  4041. "$define")    ;;
  4042. "$undef")    ;;
  4043. *)
  4044. : Pyramid passes the att compile test but still needs the definition
  4045.     if Cppsym pyr ; then
  4046.         if $test "`/bin/universe`" = "att" ; then
  4047.         d_utimbuf="$undef"
  4048.         echo "I will use my 'utimbuf' structure..."
  4049.             fi
  4050.     else
  4051.       if $test "$d_utimbuf" != "$define"; then
  4052.           echo "Checking to see if struct utimbuf exists."
  4053.           $cat >try.c <<'EOCP'
  4054. #include <stdio.h>
  4055. #include <fcntl.h>
  4056. #include <sys/types.h>
  4057. #include <sys/stat.h>
  4058. #define far /* to keep Xenix from complaining */
  4059. #if (defined(BSD) || !defined(apollo))
  4060. #  include <sys/file.h>
  4061. #endif
  4062. #ifdef I_TIME
  4063. #  include <time.h>
  4064. #endif
  4065. #ifdef I_SYSTIME
  4066. #  include <sys/time.h>
  4067. #endif
  4068. #ifdef BSD
  4069. #  include <sys/timeb.h>
  4070. #endif
  4071. #ifdef I_UTIME
  4072. #  include <utime.h>
  4073. #endif
  4074. #ifdef I_SYSUTIME
  4075. #  include <sys/utime.h>
  4076. #endif
  4077.  
  4078. main()
  4079. {
  4080. struct utimbuf test;
  4081. test.actime = 0;
  4082. exit(1);
  4083. }
  4084. EOCP
  4085.           cflags=$ccflags
  4086.           if $test "$i_utime" = "$define"; then
  4087.           cflags="$cflags -DI_UTIME"
  4088.           fi
  4089.           if $test "$i_sysutime" = "$define"; then
  4090.           cflags="$cflags -DI_SYSUTIME"
  4091.           fi
  4092.           if $test "$i_time" = "$define"; then
  4093.           cflags="$cflags -DI_TIME"
  4094.           fi
  4095.           if $test "$i_systime" = "$define"; then
  4096.           cflags="$cflags -DI_SYSTIME"
  4097.           fi
  4098.           if $test "$d_bsd" = "$define"; then
  4099.           cflags="$cflags -DBSD"
  4100.           fi
  4101.           if $cc $cflags try.c -o try >/dev/null 2>&1 ; then
  4102.           d_utimbuf="$define"
  4103.           echo "You have the 'utimbuf' structure..."
  4104.           else
  4105.           echo "I will use my 'utimbuf' structure..."
  4106.           d_utimbuf="$undef"
  4107.           fi
  4108.           $rm -f try.c try.o try
  4109.         fi
  4110.     fi
  4111.     ;;
  4112. esac
  4113.  
  4114. : see if there is a vfork
  4115. if Cppsym sgi ; then
  4116.     d_vfork="$undef"
  4117. else
  4118.     set vfork d_vfork
  4119.     eval $inlibc
  4120. fi
  4121.  
  4122. : see if memory.h is in includepath
  4123. echo " "
  4124. i_memory=`loc memory.h "" /usr/include $includepath`
  4125. if $test -n "$i_memory"; then
  4126.     echo "Found <memory.h>"
  4127.     i_memory="$define"
  4128. else
  4129.     echo "Did not find <memory.h>"
  4130.     i_memory="$undef"
  4131. fi
  4132.  
  4133. : see if unistd.h is in includepath
  4134. echo " "
  4135. i_unistd=`loc unistd.h "" /usr/include $includepath`
  4136. if $test -n "$i_unistd"; then
  4137.     echo "Found <unistd.h>"
  4138.     i_unistd="$define"
  4139. else
  4140.     echo "Did not find <unistd.h>"
  4141.     i_unistd="$undef"
  4142. fi
  4143.  
  4144. : see if signal is declared as pointer to function returning int or void
  4145. echo " "
  4146. $cppstdin $cppflags < /usr/include/signal.h >$$.tmp
  4147. if $contains 'void.*[^s]signal' $$.tmp >/dev/null 2>&1 ; then
  4148.     echo "You have void (*signal())() instead of int."
  4149.     sigtype="void"
  4150. elif $contains 'int.*[^s]signal' $$.tmp >/dev/null 2>&1 ; then
  4151.     echo "You have int (*signal())() instead of void."
  4152.     sigtype="int"
  4153. elif $contains 'extern[     ]*[(\*]*signal' $$.tmp >/dev/null 2>&1 ; then
  4154.     echo "You have int (*signal())() instead of void."
  4155.     sigtype="int"
  4156. elif $contains 'sigfunc_t.*[^s]signal' $$.tmp >/dev/null 2>&1 ; then
  4157.     echo "You have sigfunc_t (*signal())() instead of int."
  4158.     sigtype="sigfunc_t"
  4159. elif $test -n "$sigtype"; then
  4160.     echo $n "As you already told me, signal handlers return $sigtype"
  4161. else
  4162.     echo "I can't determine whether signal handlers return void or int..."
  4163.     echo "I'm assuming they return void like ANSI and POSIX want."
  4164.     echo "If not, you will have to change sigtype to match the typedef"
  4165.     echo "used by the signal handlers.  Change it config.sh at the edit "
  4166.     echo "question at the end of Configure."
  4167.     sigtype="void"
  4168. fi
  4169. rm -f $$.tmp
  4170.  
  4171. : preserve RCS keywords in files with variable substitution, grrr
  4172. Log='$Log'
  4173. Header='$Header'
  4174.  
  4175. : see if there is a strftime
  4176. set strftime d_strftime
  4177. eval $inlibc
  4178.  
  4179. : get default batch subject
  4180. $cat <<EOM
  4181.  
  4182. Elm will provide a default subject for mail messages that are sent
  4183. in batch mode (redirected from a file.)
  4184. EOM
  4185.  
  4186. case "$defbatsub" in
  4187.     '') dflt='no subject (file transmission)';;
  4188.     *)  dflt="$defbatsub";;
  4189. esac
  4190. echo " "
  4191. rp="Default batch subject: [$dflt]"
  4192. $echo $n "$rp $c"
  4193. . myread
  4194. defbatsub="$ans"
  4195.  
  4196. : determine default editor
  4197. case "$defeditor" in
  4198. '')
  4199.     case "$vi" in
  4200.     */*) dflt="$vi";;
  4201.     *) dflt=/usr/ucb/vi;;
  4202.     esac
  4203.     ;;
  4204. *)  dflt="$defeditor"
  4205.     ;;
  4206. esac
  4207.  
  4208. $cat <<EOM
  4209.  
  4210. Elm must be configured with a default editor.  On most systems this may
  4211. be 'vi'.  If you prefer to use some other, easier editor enter it here.
  4212. You will be given a change to provide command line options to this
  4213. command in the next question.
  4214.  
  4215. EOM
  4216.  
  4217. cont=true
  4218. while $test "$cont" ; do
  4219.     echo " "
  4220.     rp="What is the default editor on your system? [$dflt]"
  4221.     $echo $n "$rp $c"
  4222.     . myread
  4223.     defeditor="$ans"
  4224.     if $test -f "$ans"; then
  4225.     cont=''
  4226.     else
  4227.     lookup=`loc "$ans" "" . $pth`
  4228.     if $test -f "$lookup"; then
  4229.         cont=''
  4230.         defeditor=$lookup
  4231.     else
  4232.         if $test "$fastread" = yes; then
  4233.             dflt=y
  4234.         else
  4235.             dflt=n
  4236.         fi
  4237.         echo "Editor $ans doesn't exist."
  4238.         rp="Use that name anyway? [$dflt]"
  4239.         $echo $n "$rp $c"
  4240.         . myread
  4241.         dflt=''
  4242.         case "$ans" in
  4243.         y*) cont='';;
  4244.         esac
  4245.         fi
  4246.     fi
  4247. done
  4248.  
  4249. : determine the editor flags to use
  4250. $cat <<EOM
  4251.  
  4252. If this editor requires any options for proper use, specify them
  4253. here.  To specify no options, enter the word "none".  For example,
  4254. 'pico' users will want to use the -t option.  This is the proper
  4255. place to specify that option.
  4256.  
  4257. EOM
  4258. dflt="$editoropts"
  4259. rp="What options should Elm use with $defeditor: [$dflt]"
  4260. $echo $n "$rp $c"
  4261. . myread
  4262. editoropts=$ans
  4263. case "$editoropts" in
  4264. 'none') editoropts=''
  4265.      ;;
  4266. esac
  4267.  
  4268. : determine where public libraries go
  4269. case "$lib" in
  4270. '')
  4271.     dflt=`loc . "." /usr/local/lib /usr/lib /lib`
  4272.     ;;
  4273. *)  dflt="$lib"
  4274.     ;;
  4275. esac
  4276. cont=true
  4277. while $test "$cont" ; do
  4278.     echo " "
  4279.     rp="Where do you want to put the public libraries? [$dflt]"
  4280.     $echo $n "$rp $c"
  4281.     . myread
  4282.     lib="$ans"
  4283.     lib=`filexp $lib`
  4284.     if $test -d "$lib"; then
  4285.     cont=''
  4286.     else
  4287.     dflt=n
  4288.     rp="Directory $lib doesn't exist.  Use that name anyway? [$dflt]"
  4289.     $echo $n "$rp $c"
  4290.     . myread
  4291.     dflt=''
  4292.     case "$ans" in
  4293.     y*) cont='';;
  4294.     esac
  4295.     fi
  4296. done
  4297.  
  4298. : ask the preferred line printer and options for this system.
  4299. case "$linepr" in
  4300. '')
  4301.     if $test -f "$lp"; then
  4302.     dflt="$lp"
  4303.     elif $test -f "$lpr"; then
  4304.     dflt="$lpr"
  4305.     else
  4306.     dflt=
  4307.     fi
  4308.     ;;
  4309. *)  dflt="$linepr";;
  4310. esac
  4311.  
  4312. linepr='blurfl/dyick'
  4313. $cat <<EOM
  4314.  
  4315. Elm has an option to send messages to the printer.  This question
  4316. asks for the default spooler name.  You can also specify options to
  4317. the command by separating them from the command by at least one space. 
  4318.  
  4319. EOM
  4320. cont=true
  4321. while $test "$cont" ; do
  4322.     rp="What print spooler do you prefer to use with Elm? [$dflt]"
  4323.     $echo $n "$rp $c"
  4324.     . myread
  4325.     linepr="$ans"
  4326.     ans=`$expr "$linepr" : "\([^ ]*\).*"`
  4327.     case "$ans" in
  4328.     /*)
  4329.     if $test -f "$ans"; then
  4330.         cont=''
  4331.     else
  4332.         if $test "$fastread" = yes; then
  4333.         dflt=y
  4334.         else
  4335.         dflt=n
  4336.         fi
  4337.         rp="File $ans doesn't exist.  Use that name anyway? [$dflt]"
  4338.         $echo $n "$rp $c"
  4339.         . myread
  4340.         case "$ans" in
  4341.         y*) cont='';;
  4342.         esac
  4343.     fi
  4344.     ;;
  4345.     *)
  4346.         if $test "$fastread" = yes; then
  4347.         echo "The print spooler needs to be a full path name."
  4348.         echo "Using the current, possibly improper, value."
  4349.         cont=''
  4350.     else
  4351.         echo "Please give the full path name."
  4352.     fi
  4353.     ;;
  4354.     esac
  4355. done
  4356.  
  4357. : ask the preferred pager for this system.
  4358. case "$pager" in
  4359. '') dflt="builtin+";;
  4360. *)  dflt="$pager";;
  4361. esac
  4362.  
  4363. pager='blurfl/dyick'
  4364. echo " "
  4365. cont=true
  4366. while $test "$cont" ; do
  4367.     rp="What pager do you prefer to use with $package? [$dflt]"
  4368.     $echo $n "$rp $c"
  4369.     . myread
  4370.     pager="$ans"
  4371.     case "$ans" in
  4372.     builtin)
  4373.         cont=''
  4374.     ;;
  4375.     builtin+)
  4376.         cont=''
  4377.     ;;
  4378.     /*)
  4379.     if $test -f "$ans"; then
  4380.         cont=''
  4381.     else
  4382.         if $test "$fastread" = yes; then
  4383.         dflt=y
  4384.         else
  4385.         dflt=n
  4386.         fi
  4387.         rp="File $ans doesn't exist.  Use that name anyway? [$dflt]"
  4388.         $echo $n "$rp $c"
  4389.         . myread
  4390.         case "$ans" in
  4391.         y*) cont='';;
  4392.         esac
  4393.     fi
  4394.     ;;
  4395.     *)
  4396.     echo "Please give the full path name."
  4397.     ;;
  4398.     esac
  4399. done
  4400.  
  4401. : find out which shell people like to use most
  4402. case "$prefshell" in
  4403. '')
  4404.     if $test -f /bin/ksh; then
  4405.     dflt='/bin/ksh'
  4406.     elif $test -f /bin/csh; then
  4407.     dflt='/bin/csh'
  4408.     else
  4409.     dflt='/bin/sh'
  4410.     fi
  4411.     ;;
  4412. *)  dflt="$prefshell";;
  4413. esac
  4414. cont=true
  4415. while $test "$cont" ; do
  4416.     echo " "
  4417.     echo "Give the full path name of the shell most people like to use on your"
  4418.     $echo $n "system: [$dflt] $c"
  4419.     rp="Preferred shell: [$dflt]"
  4420.     . myread
  4421.     prefshell=$ans
  4422.     if test -f $ans; then
  4423.     cont=''
  4424.     else
  4425.     if $test "$fastread" = yes; then
  4426.         dflt=y
  4427.     else
  4428.         dflt=n
  4429.     fi
  4430.     rp="File $ans doesn't exist.  Use that name anyway? [$dflt]"
  4431.     $echo $n "$rp $c"
  4432.     . myread
  4433.     dflt=''
  4434.     case "$ans" in
  4435.     y*) cont='';;
  4436.     esac
  4437.     fi
  4438. done
  4439.  
  4440. : see if ar generates random libraries by itself
  4441. echo " "
  4442. echo "Checking how to generate random libraries on your machine..."
  4443. ar rc ran.a /dev/null
  4444. if ar ts ran.a >/dev/null 2>&1; then
  4445.     echo "ar appears to generate random libraries itself."
  4446.     orderlib=false
  4447.     ranlib=":"
  4448. else
  4449.     if test -f /usr/bin/ranlib; then
  4450.         ranlib=/usr/bin/ranlib
  4451.     elif test -f /bin/ranlib; then
  4452.         ranlib=/bin/ranlib
  4453.     fi
  4454.  
  4455.     if test -n "$ranlib"; then
  4456.         echo "your system has $ranlib; we'll use that."
  4457.         orderlib=false
  4458.     else
  4459.         echo "your system doesn't seem to support random libraries"
  4460.         echo "so we'll use lorder and tsort to order the libraries."
  4461.         orderlib=true
  4462.         ranlib=":"
  4463.     fi
  4464. fi
  4465.  
  4466. : determine the name of the tape device
  4467. rmttape=`loc rct0 "" /dev`
  4468. if $test -z "$rmttape"; then
  4469.     rmttape=`loc rmt0 "" /dev`
  4470. fi
  4471. if $test -z "$rmttape"; then
  4472.     rmttape=`loc rtp0 "unknown-remote-tape-unit" /dev`
  4473. fi
  4474. echo "remote tape drive is $rmttape"
  4475. echo " "
  4476. : where do we get termlib routines from
  4477. echo " "
  4478. case "$d_havetlib" in
  4479. "$define")
  4480.     echo "Termlib routines in '$termlib' from prior Configure run"
  4481.     ;;
  4482. *)
  4483.     ans=`loc libtermlib.a x $libpth`
  4484.     if $test "$ans" = x; then
  4485.         ans=`loc Slibtermlib.a x $libpth`
  4486.     fi
  4487.     case "$ans" in
  4488.     /usr/lib*|/usr/ccs/lib*|/lib*)
  4489.     termlib='-ltermlib'
  4490.     d_havetlib="$define"
  4491.     echo "Termlib library found."
  4492.     ;;
  4493.     /*)
  4494.     termlib="$ans"
  4495.     d_havetlib="$define"
  4496.     echo "Termlib library found."
  4497.     ;;
  4498.     *)
  4499.     ans=`loc libcurses.a x $libpth`
  4500.     if $test "$ans" = x; then
  4501.         ans=`loc Slibcurses.a x $libpth`
  4502.     fi
  4503.     case "$ans" in
  4504.     /*)
  4505.         ar t $ans >grimble
  4506.         if $contains tputs.o grimble >/dev/null 2>&1; then
  4507.         termlib='-lcurses'
  4508.         d_havetlib="$define"
  4509.         echo "Terminfo routines found in -lcurses library."
  4510.         else
  4511.         ans=x
  4512.         fi
  4513.         rm -f grimble
  4514.         ;;
  4515.     esac
  4516.     esac
  4517.     if $test "$ans" = x; then
  4518.     ans=`loc libtermcap.a x $libpth`
  4519.     if $test "$ans" = x; then
  4520.         ans=`loc Slibtermcap.a x $libpth`
  4521.     fi
  4522.     case "$ans" in
  4523.     /usr/lib*|/usr/ccs/lib*|/lib*)
  4524.         termlib='-ltermcap'
  4525.         d_havetlib="$define"
  4526.         echo "Termcap library found."
  4527.         ;;
  4528.     /*)
  4529.         termlib="$ans"
  4530.         d_havetlib="$define"
  4531.         echo "Termcap library found."
  4532.         ;;
  4533.     *)
  4534.         case "$termlib" in
  4535.         '')
  4536.         dflt=y
  4537.         rp="Your system appears to NOT have termlib-style routines.  Is this true? [$dflt]"
  4538.         $echo $n "$rp $c"
  4539.         . myread
  4540.         case "$ans" in
  4541.             n*|f*) d_havetlib="$define"
  4542.               echo "Then where are the termlib-style routines kept (specify either -llibname"
  4543.               $echo $n " or full pathname (~name ok))? $c"
  4544.               rp='Specify termlib:'
  4545.               . myread
  4546.               termlib=`filexp $ans`
  4547.               ;;
  4548.             *)    d_havetlib="$undef"
  4549.               termlib=''
  4550.               echo "You will have to play around with term.c then."
  4551.               ;;
  4552.         esac
  4553.         echo " "
  4554.         ;;
  4555.         *)  echo "You said termlib was $termlib before."
  4556.         ;;
  4557.         esac
  4558.         ;;
  4559.     esac
  4560.     fi
  4561.     ;;
  4562. esac
  4563. : determine where temporary files should go
  4564. case "$tmpdir" in
  4565. '')
  4566.     dflt=`loc . "." "/tmp /usr/tmp"`
  4567.     ;;
  4568. *)  dflt="$tmpdir"
  4569.     ;;
  4570. esac
  4571. if $test -d "$tmpdir" -a "$tmpdir" != ""; then
  4572.     $echo " "
  4573.     $echo "Temporary files will be put in the $tmpdir directory"
  4574. else
  4575.     cont=true
  4576.     while $test "$cont" ; do
  4577.         $echo " "
  4578.         rp="Where do you want to put the temporary files? [$dflt]"
  4579.         $echo $n "$rp $c"
  4580.         . myread
  4581.         tmpdir="$ans"
  4582.         tmpdir=`filexp $tmpdir`
  4583.         if $test -d "$tmpdir" -a "$tmpdir" != ""; then
  4584.         cont=''
  4585.         else
  4586.         if $test "$fastread" = yes; then
  4587.             dflt=y
  4588.         else
  4589.             dflt=n
  4590.         fi
  4591.         rp="Directory $tmpdir doesn't exist.  Use that name anyway? [$dflt]"
  4592.         $echo $n "$rp $c"
  4593.         . myread
  4594.         dflt=''
  4595.         case "$ans" in
  4596.         y*) cont='';;
  4597.         esac
  4598.         fi
  4599.     done
  4600. fi
  4601.  
  4602. : if pmake exists, allow its use for parallel make
  4603.  
  4604. if $test -f "$pmake" ; then
  4605.     case "$use_pmake" in
  4606.     n)  dflt=n;;
  4607.     *)  dflt=y;;
  4608.     esac
  4609.  
  4610.     $cat <<EOM
  4611.  
  4612. The executable file pmake was found on this system.  Usually this
  4613. file indicates a parallel make, which executes much faster.  Should
  4614. this system use the pmake command as its make command?
  4615.  
  4616. EOM
  4617.     rp="Does this system use pmake as its make? [$dflt]"
  4618.     $echo $n "$rp $c"
  4619.     . myread
  4620.     case "$ans" in
  4621.     y*) use_pmake=y
  4622.         make="$pmake";;
  4623.     *)  use_pmake=n;;
  4624.     esac
  4625. else
  4626.     use_pmake=n
  4627. fi
  4628.  
  4629. : the "config.over" file can be used to patch configuration changes
  4630. if test -f ../config.over ; then
  4631.     echo " "
  4632.     echo "I have found a \"config.over\" file."
  4633.     dflt=y
  4634.     rp="Do you want to load the \"config.over\" file? [$dflt]"
  4635.     $echo $n "$rp $c"
  4636.     . myread
  4637.     case "$ans" in
  4638.         n*)    echo "OK, I'll ignore it."
  4639.         ;;
  4640.     *)    . ../config.over
  4641.         echo "Configuration override changes have been loaded from config.over."
  4642.         ;;
  4643.     esac
  4644. fi
  4645.  
  4646. : clean up one time files
  4647. for file in OneTime.PL* ; do
  4648.     if test -f "$file" ; then
  4649.         echo "Removing patch cleanup script $file . . ."
  4650.         rm -f $file
  4651.     fi
  4652. done
  4653.  
  4654. echo " "
  4655. echo "End of configuration questions."
  4656. echo " "
  4657.  
  4658. : create config.sh file
  4659. echo " "
  4660. if test -d ../UU; then
  4661.     cd ..
  4662. fi
  4663. echo "Creating config.sh..."
  4664. $spitshell <<EOT >config.sh
  4665. $startsh
  4666. # config.sh
  4667. # This file was produced by running the Configure script.
  4668.  
  4669. Log='$Log'
  4670. Header='$Header'
  4671. bin='$bin'
  4672. contains='$contains'
  4673. cppstdin='$cppstdin'
  4674. cppminus='$cppminus'
  4675. d_getopt='$d_getopt'
  4676. d_memcpy='$d_memcpy'
  4677. d_mkdir='$d_mkdir'
  4678. d_rename='$d_rename'
  4679. d_symlink='$d_symlink'
  4680. d_whoami='$d_whoami'
  4681. n='$n'
  4682. c='$c'
  4683. orderlib='$orderlib'
  4684. ranlib='$ranlib'
  4685. package='$package'
  4686. pager='$pager'
  4687. prefshell='$prefshell'
  4688. startsh='$startsh'
  4689. d_eunice='$d_eunice'
  4690. define='$define'
  4691. eunicefix='$eunicefix'
  4692. loclist='$loclist'
  4693. expr='$expr'
  4694. sed='$sed'
  4695. echo='$echo'
  4696. cat='$cat'
  4697. rm='$rm'
  4698. mv='$mv'
  4699. cp='$cp'
  4700. tail='$tail'
  4701. tr='$tr'
  4702. mkdir='$mkdir'
  4703. sort='$sort'
  4704. uniq='$uniq'
  4705. grep='$grep'
  4706. trylist='$trylist'
  4707. test='$test'
  4708. inews='$inews'
  4709. ispell='$ispell'
  4710. egrep='$egrep'
  4711. more='$more'
  4712. pg='$pg'
  4713. Mcc='$Mcc'
  4714. vi='$vi'
  4715. mailx='$mailx'
  4716. mail='$mail'
  4717. cpp='$cpp'
  4718. perl='$perl'
  4719. emacs='$emacs'
  4720. ls='$ls'
  4721. rmail='$rmail'
  4722. sendmail='$sendmail'
  4723. shar='$shar'
  4724. smail='$smail'
  4725. submit='$submit'
  4726. tbl='$tbl'
  4727. troff='$troff'
  4728. nroff='$nroff'
  4729. uname='$uname'
  4730. uuname='$uuname'
  4731. line='$line'
  4732. chgrp='$chgrp'
  4733. chmod='$chmod'
  4734. lint='$lint'
  4735. sleep='$sleep'
  4736. pr='$pr'
  4737. tar='$tar'
  4738. ln='$ln'
  4739. lpr='$lpr'
  4740. lp='$lp'
  4741. touch='$touch'
  4742. make='$make'
  4743. date='$date'
  4744. csh='$csh'
  4745. pmake='$pmake'
  4746. mips='$mips'
  4747. col='$col'
  4748. pack='$pack'
  4749. compress='$compress'
  4750. execmail='$execmail'
  4751. libswanted='$libswanted'
  4752. c_date='$c_date'
  4753. d_altcheck='$d_altcheck'
  4754. d_ascii='$d_ascii'
  4755. d_calendar='$d_calendar'
  4756. calendar='$calendar'
  4757. d_content='$d_content'
  4758. d_crypt='$d_crypt'
  4759. cryptlib='$cryptlib'
  4760. d_cuserid='$d_cuserid'
  4761. d_disphost='$d_disphost'
  4762. d_domname='$d_domname'
  4763. d_usegetdom='$d_usegetdom'
  4764. d_errlst='$d_errlst'
  4765. d_flock='$d_flock'
  4766. d_dotlock='$d_dotlock'
  4767. d_fcntlock='$d_fcntlock'
  4768. lock_dir='$lock_dir'
  4769. has_flock='$has_flock'
  4770. has_fcntl='$has_fcntl'
  4771. d_ftruncate='$d_ftruncate'
  4772. d_gethname='$d_gethname'
  4773. d_douname='$d_douname'
  4774. d_host_comp='$d_host_comp'
  4775. ign_hname='$ign_hname'
  4776. d_havetlib='$d_havetlib'
  4777. termlib='$termlib'
  4778. d_index='$d_index'
  4779. d_internet='$d_internet'
  4780. d_ispell='$d_ispell'
  4781. ispell_path='$ispell_path'
  4782. ispell_options='$ispell_options'
  4783. d_locale='$d_locale'
  4784. d_nl_types='$d_nl_types'
  4785. d_msgcat='$d_msgcat'
  4786. d_usenls='$d_usenls'
  4787. d_mallocvoid='$d_mallocvoid'
  4788. d_mboxedit='$d_mboxedit'
  4789. d_mime='$d_mime'
  4790. defencoding='$defencoding'
  4791. defcharset='$defcharset'
  4792. defdispcharset='$defdispcharset'
  4793. d_mmdf='$d_mmdf'
  4794. d_newauto='$d_newauto'
  4795. d_noaddfrom='$d_noaddfrom'
  4796. d_usedomain='$d_usedomain'
  4797. d_nocheckvalid='$d_nocheckvalid'
  4798. d_noxheader='$d_noxheader'
  4799. d_pidcheck='$d_pidcheck'
  4800. d_ptem='$d_ptem'
  4801. d_putenv='$d_putenv'
  4802. d_remlock='$d_remlock'
  4803. maxattempts='$maxattempts'
  4804. d_setgid='$d_setgid'
  4805. d_savegrpmboxid='$d_savegrpmboxid'
  4806. mailermode='$mailermode'
  4807. d_sigvec='$d_sigvec'
  4808. d_sigvectr='$d_sigvectr'
  4809. d_sigset='$d_sigset'
  4810. d_sighold='$d_sighold'
  4811. d_sigprocmask='$d_sigprocmask'
  4812. d_sigblock='$d_sigblock'
  4813. d_sigaction='$d_sigaction'
  4814. d_strcspn='$d_strcspn'
  4815. d_strspn='$d_strspn'
  4816. d_strpbrk='$d_strpbrk'
  4817. d_strerror='$d_strerror'
  4818. d_strftime='$d_strftime'
  4819. d_strings='$d_strings'
  4820. d_pwdinsys='$d_pwdinsys'
  4821. strings='$strings'
  4822. includepath='$includepath'
  4823. d_strstr='$d_strstr'
  4824. d_strtok='$d_strtok'
  4825. d_subshell='$d_subshell'
  4826. d_tempnam='$d_tempnam'
  4827. tempnamo='$tempnamo'
  4828. tempnamc='$tempnamc'
  4829. d_termio='$d_termio'
  4830. d_termios='$d_termios'
  4831. d_tz_min='$d_tz_min'
  4832. d_tzname='$d_tzname'
  4833. d_useembed='$d_useembed'
  4834. d_utimbuf='$d_utimbuf'
  4835. d_vfork='$d_vfork'
  4836. defbatsub='$defbatsub'
  4837. defeditor='$defeditor'
  4838. editoropts='$editoropts'
  4839. hostname='$hostname'
  4840. phostname='$phostname'
  4841. mydomain='$mydomain'
  4842. autohostname='$autohostname'
  4843. i_memory='$i_memory'
  4844. i_stdlib='$i_stdlib'
  4845. i_time='$i_time'
  4846. i_systime='$i_systime'
  4847. d_systimekernel='$d_systimekernel'
  4848. i_unistd='$i_unistd'
  4849. i_utime='$i_utime'
  4850. i_sysutime='$i_sysutime'
  4851. lib='$lib'
  4852. libc='$libc'
  4853. linepr='$linepr'
  4854. maildir='$maildir'
  4855. mailer='$mailer'
  4856. mailgrp='$mailgrp'
  4857. mansrc='$mansrc'
  4858. catmansrc='$catmansrc'
  4859. manext='$manext'
  4860. manext_choice='$manext_choice'
  4861. catmanext='$catmanext'
  4862. catmanext_choice='$catmanext_choice'
  4863. packed='$packed'
  4864. manroff='$manroff'
  4865. manroffopts='$manroffopts'
  4866. suffix='$suffix'
  4867. packer='$packer'
  4868. models='$models'
  4869. split='$split'
  4870. small='$small'
  4871. medium='$medium'
  4872. large='$large'
  4873. huge='$huge'
  4874. optimize='$optimize'
  4875. ccflags='$ccflags'
  4876. cppflags='$cppflags'
  4877. ldflags='$ldflags'
  4878. cc='$cc'
  4879. libs='$libs'
  4880. nametype='$nametype'
  4881. d_passnames='$d_passnames'
  4882. d_berknames='$d_berknames'
  4883. d_usgnames='$d_usgnames'
  4884. passcat='$passcat'
  4885. rmttape='$rmttape'
  4886. roff='$roff'
  4887. roffopts='$roffopts'
  4888. sigtype='$sigtype'
  4889. spitshell='$spitshell'
  4890. shsharp='$shsharp'
  4891. sharpbang='$sharpbang'
  4892. tmpdir='$tmpdir'
  4893. use_pmake='$use_pmake'
  4894. xencf='$xencf'
  4895. xenlf='$xenlf'
  4896. d_xenix='$d_xenix'
  4897. d_bsd='$d_bsd'
  4898. CONFIG=true
  4899. EOT
  4900.  
  4901. CONFIG=true
  4902.  
  4903. echo " "
  4904. dflt=''
  4905. fastread=''
  4906. echo "If you didn't make any mistakes, then just type a carriage return here."
  4907. rp="If you need to edit config.sh, do it as a shell escape here:"
  4908. $echo $n "$rp $c"
  4909. . UU/myread
  4910. case "$ans" in
  4911. '') ;;
  4912. *) : in case they cannot read
  4913.     eval $ans;;
  4914. esac
  4915. : if this fails, just run all the .SH files by hand
  4916. . ./config.sh
  4917.  
  4918. echo " "
  4919. echo "Doing variable substitutions on .SH files..."
  4920. set x `awk '{print $1}' <MANIFEST | $grep '\.SH'`
  4921. shift
  4922. case $# in
  4923. 0) set x *.SH; shift;;
  4924. esac
  4925. if test ! -f $1; then
  4926.     shift
  4927. fi
  4928. for file in $*; do
  4929.     case "$file" in
  4930.     */*)
  4931.     dir=`$expr X$file : 'X\(.*\)/'`
  4932.     file=`$expr X$file : 'X.*/\(.*\)'`
  4933.     (cd $dir && . $file)
  4934.     ;;
  4935.     *)
  4936.     . $file
  4937.     ;;
  4938.     esac
  4939. done
  4940. if test -f config.h.SH; then
  4941.     if test ! -f config.h; then
  4942.     : oops, they left it out of MANIFEST, probably, so do it anyway.
  4943.     . config.h.SH
  4944.     fi
  4945. fi
  4946.  
  4947. if $contains '^depend:' Makefile >/dev/null 2>&1; then
  4948.     dflt=n
  4949.     $cat <<EOM
  4950.  
  4951. Now you need to generate make dependencies by running "make depend".
  4952. You might prefer to run it in background: "make depend > makedepend.out &"
  4953. It can take a while, so you might not want to run it right now.
  4954.  
  4955. EOM
  4956.     rp="Run make depend now? [$dflt]"
  4957.     $echo $n "$rp $c"
  4958.     . UU/myread
  4959.     case "$ans" in
  4960.     y*) make depend && echo "Now you must run a make."
  4961.     ;;
  4962.     *)  echo "You must run 'make depend' then 'make'."
  4963.     ;;
  4964.     esac
  4965. elif test -f Makefile; then
  4966.     echo " "
  4967.     echo "Now you must run a make."
  4968. else
  4969.     echo "Done."
  4970. fi
  4971.  
  4972. $rm -f kit*isdone
  4973. : the following is currently useless
  4974. cd UU && $rm -f $rmlist
  4975. : since this removes it all anyway
  4976. cd .. && $rm -rf UU
  4977. : end of Configure
  4978.